diff --git a/.github/actions/check-for-CLA/index.js b/.github/actions/check-for-CLA/index.js index 68684a92624a..56ece7b8e03b 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/.markdownlintignore b/.markdownlintignore index 1a14e901388e..65e41410d42e 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,6 +1,7 @@ /node_modules /ThirdParty /Tools/** +temp_wasm/* -CHANGES.md -LICENSE.md \ No newline at end of file +CHANGES.md +LICENSE.md diff --git a/Apps/CesiumViewer/CesiumViewer.js b/Apps/CesiumViewer/CesiumViewer.js index 37325b668f78..3a07da944985 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 5732efc965c0..9bd37df259f2 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 23831dbf99fe..277d7479d7b2 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 ddce4d5e04f4..9f8d87e99120 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 6884c209065e..aa6a61ca5f73 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 5acd572c626e..d6ebbb0e8858 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 5c9c0ad51570..58a042f62c12 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 57c0aedc1daa..a0df5ede65d0 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" /> @@ -218,7 +218,7 @@ const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height, + height ); const heading = Cesium.Math.toRadians(135); const pitch = 0; @@ -239,7 +239,7 @@ colorBlendAmount: parseFloat(viewModel.colorBlendAmount), silhouetteColor: getColor( viewModel.silhouetteColor, - viewModel.silhouetteAlpha, + viewModel.silhouetteAlpha ), silhouetteSize: parseFloat(viewModel.silhouetteSize), }, @@ -265,7 +265,7 @@ onselect: function () { createModel( "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", - 1000.0, + 1000.0 ); }, }, @@ -274,7 +274,7 @@ onselect: function () { createModel( "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", - 0, + 0 ); }, }, diff --git a/Apps/Sandcastle/gallery/3D Models.html b/Apps/Sandcastle/gallery/3D Models.html index a2c16fc7a2af..9be76299ec57 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" /> @@ -42,7 +42,7 @@ const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height, + height ); const heading = Cesium.Math.toRadians(135); const pitch = 0; @@ -87,7 +87,7 @@ onselect: function () { createModel( "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", - 1000.0, + 1000.0 ); }, }, @@ -96,7 +96,7 @@ onselect: function () { createModel( "../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck.glb", - 0, + 0 ); }, }, @@ -117,7 +117,7 @@ onselect: function () { createModel( "../../SampleData/models/DracoCompressed/CesiumMilkTruck.gltf", - 0, + 0 ); }, }, @@ -126,12 +126,12 @@ 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 ); }, }, 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 99e12eb214b0..4fc2b457e456 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" /> @@ -41,7 +41,7 @@ const viewer = new Cesium.Viewer("cesiumContainer", {}); viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2021-11-09T07:27:37.016064475348684937Z", + "2021-11-09T07:27:37.016064475348684937Z" ); const scene = viewer.scene; scene.light.intensity = 7.0; @@ -51,68 +51,68 @@ destination: new Cesium.Cartesian3( 4397999.822774582, 4404502.67774069, - 1397782.4709840622, + 1397782.4709840622 ), direction: new Cesium.Cartesian3( -0.29335588497705106, -0.6066709587467911, - 0.7388454997917905, + 0.7388454997917905 ), up: new Cesium.Cartesian3( 0.6240972421637774, 0.46391380837591956, - 0.6287182283994301, + 0.6287182283994301 ), }, airport: { destination: new Cesium.Cartesian3( 4394719.151490939, 4402317.401942875, - 1406608.6602404779, + 1406608.6602404779 ), direction: new Cesium.Cartesian3( 0.4146699515908668, -0.8887814163588482, - 0.1952342828060377, + 0.1952342828060377 ), up: new Cesium.Cartesian3( 0.8415067525520951, 0.4561872920946922, - 0.28941240460723, + 0.28941240460723 ), }, crater: { destination: new Cesium.Cartesian3( 4398179.160380196, 4402518.469409466, - 1399161.7612076725, + 1399161.7612076725 ), direction: new Cesium.Cartesian3( -0.2800903637088597, -0.6348021519070498, - 0.7201219452923355, + 0.7201219452923355 ), up: new Cesium.Cartesian3( 0.6319189548885261, 0.4427783126727723, - 0.6361020360596605, + 0.6361020360596605 ), }, port: { destination: new Cesium.Cartesian3( 4399698.85724341, 4399019.639078034, - 1405153.7766045567, + 1405153.7766045567 ), direction: new Cesium.Cartesian3( -0.5651458936543287, 0.17696574231117793, - -0.8057873447342694, + -0.8057873447342694 ), up: new Cesium.Cartesian3( 0.4886488937394081, 0.8587605935024302, - -0.15411846642958343, + -0.15411846642958343 ), }, }; @@ -221,7 +221,7 @@ metadataOverlay.style.left = `${movement.endPosition.x}px`; tableHtmlScratch = `<table><thead><tr><td>Material:</td><th><tt>${feature.getProperty( - "name", + "name" )}</tt></tr></thead><tbody>`; materialsScratch = feature.getProperty("substrates"); @@ -231,7 +231,7 @@ for (i = 0; i < materialsScratch.length; i++) { tableHtmlScratch += `<tr><td><tt>${materialsScratch[i].slice( - 3, + 3 )}</tt></td><td style='text-align: right;'><tt>${ weightsScratch[i] }%</tt></td></tr>`; @@ -303,7 +303,7 @@ const propertyType = Cesium.defaultValue( property.componentType, - property.type, + property.type ); tableHtmlScratch += `<tr style='font-family: monospace;' title='${property.description}'><th>${property.name}</th><th><b>${property.id}</b></th><td>${propertyType}</td><td>${propertyValue}</td></tr>`; } @@ -411,17 +411,15 @@ } Sandcastle.addToolbarMenu(locations); - Sandcastle.addToggleButton( - "Enable terrain picking", - enablePicking, - function (checked) { - if (enablePicking) { - metadataOverlay.style.display = "none"; - } + Sandcastle.addToggleButton("Enable terrain picking", enablePicking, function ( + checked + ) { + if (enablePicking) { + metadataOverlay.style.display = "none"; + } - enablePicking = checked; - }, - ); + enablePicking = checked; + }); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry Classification.html b/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry Classification.html index 818e2987a5f1..56982b4f9036 100644 --- a/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry Classification.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -40,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; @@ -50,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, }); @@ -67,7 +67,7 @@ const translation = new Cesium.Cartesian3( -1.398521324920626, 0.7823052871729486, - 0.7015244410592609, + 0.7015244410592609 ); tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); diff --git a/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry.html b/Apps/Sandcastle/gallery/3D Tiles 1.1 Photogrammetry.html index c38b6c0d5cef..93db78acb336 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -174,10 +174,10 @@ // Create two primitive collections, one for each half of the screen. // This way we can clear one half of the screen at a time. const leftCollection = viewer.scene.primitives.add( - new Cesium.PrimitiveCollection(), + new Cesium.PrimitiveCollection() ); const rightCollection = viewer.scene.primitives.add( - new Cesium.PrimitiveCollection(), + new Cesium.PrimitiveCollection() ); // Load a tileset to one half of the screen, returning the tileset @@ -288,7 +288,7 @@ async function () { benchmarkTilesets(selectedTilesetName); }, - "toolbarSelect", + "toolbarSelect" ); // A note to the user that load time requires a button press @@ -305,8 +305,9 @@ } function updateLoadTime(side, tileLoadTimeSeconds) { - document.getElementById(`${side}TileLoadTime`).innerHTML = - tileLoadTimeSeconds.toPrecision(3); + document.getElementById( + `${side}TileLoadTime` + ).innerHTML = tileLoadTimeSeconds.toPrecision(3); } function updateStatsPanel(side, tileset) { @@ -318,8 +319,9 @@ const gpuMemoryBytes = stats.geometryByteLength + stats.texturesByteLength; const gpuMemoryMB = gpuMemoryBytes / 1024 / 1024; - document.getElementById(`${side}GpuMemoryMB`).innerHTML = - gpuMemoryMB.toPrecision(3); + document.getElementById( + `${side}GpuMemoryMB` + ).innerHTML = gpuMemoryMB.toPrecision(3); } // maximum SSE Slider ------------------------------------------------- diff --git a/Apps/Sandcastle/gallery/3D Tiles 1.1 S2 Globe.html b/Apps/Sandcastle/gallery/3D Tiles 1.1 S2 Globe.html index 6ca4f62f9dcc..e3b1417133a2 100644 --- a/Apps/Sandcastle/gallery/3D Tiles 1.1 S2 Globe.html +++ b/Apps/Sandcastle/gallery/3D Tiles 1.1 S2 Globe.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -54,18 +54,18 @@ destination: new Cesium.Cartesian3( 762079.3157173397, -28363749.882652905, - 19814354.842565004, + 19814354.842565004 ), orientation: { direction: new Cesium.Cartesian3( -0.022007098944236157, 0.819079900508189, - -0.5732571885110153, + -0.5732571885110153 ), up: new Cesium.Cartesian3( -0.015396759850986286, 0.5730503851893346, - 0.8193754913471885, + 0.8193754913471885 ), }, easingFunction: Cesium.EasingFunction.QUADRATIC_IN_OUT, diff --git a/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html b/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html index 902d9b7283da..7c7ad4a6153c 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html +++ b/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -66,13 +66,13 @@ let tileset; try { tileset = await Cesium.Cesium3DTileset.fromUrl( - "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json", + "../../SampleData/Cesium3DTiles/Tilesets/Tileset/tileset.json" ); viewer.scene.primitives.add(tileset); viewer.scene.globe.depthTestAgainstTerrain = true; viewer.zoomTo( tileset, - new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius * 2.0), + new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius * 2.0) ); } catch (error) { console.log(`Error loading tileset: ${error}`); @@ -85,22 +85,22 @@ } const cartographic = Cesium.Cartographic.fromCartesian( - tileset.boundingSphere.center, + tileset.boundingSphere.center ); const surface = Cesium.Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, - 0.0, + 0.0 ); const offset = Cesium.Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, - height, + height ); const translation = Cesium.Cartesian3.subtract( offset, surface, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); }); diff --git a/Apps/Sandcastle/gallery/3D Tiles BIM.html b/Apps/Sandcastle/gallery/3D Tiles BIM.html index 0a46649510b1..4fac7dda6b7b 100644 --- a/Apps/Sandcastle/gallery/3D Tiles BIM.html +++ b/Apps/Sandcastle/gallery/3D Tiles BIM.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -82,10 +82,40 @@ // 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) { @@ -152,7 +182,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 d93c6ad78345..9d1bb4367ff4 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -95,7 +95,7 @@ let tileset; try { tileset = await Cesium.Cesium3DTileset.fromUrl( - "../../SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tileset.json", + "../../SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tileset.json" ); viewer.scene.primitives.add(tileset); diff --git a/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html b/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html index 1c864559a48b..26063bcdbcd3 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html +++ b/Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -167,17 +167,18 @@ // Apply an additional matrix to center the clipping plane on the bounding sphere center. const transformCenter = Cesium.Matrix4.getTranslation( tileset.root.transform, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() + ); + const transformCartographic = Cesium.Cartographic.fromCartesian( + transformCenter ); - const transformCartographic = - Cesium.Cartographic.fromCartesian(transformCenter); const boundingSphereCartographic = Cesium.Cartographic.fromCartesian( - tileset.boundingSphere.center, + tileset.boundingSphere.center ); const height = boundingSphereCartographic.height - transformCartographic.height; clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation( - new Cesium.Cartesian3(0.0, 0.0, height), + new Cesium.Cartesian3(0.0, 0.0, height) ); } @@ -190,7 +191,7 @@ material: Cesium.Color.WHITE.withAlpha(0.1), plane: new Cesium.CallbackProperty( createPlaneUpdateFunction(plane), - false, + false ), outline: true, outlineColor: Cesium.Color.WHITE, @@ -242,7 +243,7 @@ material: Cesium.Color.WHITE.withAlpha(0.1), plane: new Cesium.CallbackProperty( createPlaneUpdateFunction(plane), - false, + false ), outline: true, outlineColor: Cesium.Color.WHITE, @@ -280,9 +281,7 @@ // Position the instanced tileset above terrain loadTileset( instancedUrl, - Cesium.Matrix4.fromTranslation( - new Cesium.Cartesian3(15.0, -58.6, 50.825), - ), + Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(15.0, -58.6, 50.825)) ); } else { loadModel(modelUrl); diff --git a/Apps/Sandcastle/gallery/3D Tiles Compare.html b/Apps/Sandcastle/gallery/3D Tiles Compare.html index 08e7df162bdf..18cbff2f1e37 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Compare.html +++ b/Apps/Sandcastle/gallery/3D Tiles Compare.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html b/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html index 23ae523d1666..0e1f5a5d3567 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Picking.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,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, @@ -87,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, @@ -114,20 +114,20 @@ "<tr><th>BIN</th><td>" }${pickedFeature.getProperty("BIN")}</td></tr>` + `<tr><th>DOITT ID</th><td>${pickedFeature.getProperty( - "DOITT_ID", + "DOITT_ID" )}</td></tr>` + `<tr><th>SOURCE ID</th><td>${pickedFeature.getProperty( - "SOURCE_ID", + "SOURCE_ID" )}</td></tr>` + `<tr><th>Longitude</th><td>${pickedFeature.getProperty( - "Longitude", + "Longitude" )}</td></tr>` + `<tr><th>Latitude</th><td>${pickedFeature.getProperty( - "Latitude", + "Latitude" )}</td></tr>` + `<tr><th>Height</th><td>${pickedFeature.getProperty("Height")}</td></tr>` + `<tr><th>Terrain Height (Ellipsoid)</th><td>${pickedFeature.getProperty( - "TerrainHeight", + "TerrainHeight" )}</td></tr>` + `</tbody></table>`; return description; @@ -137,14 +137,12 @@ // 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)) { // 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 = []; @@ -153,7 +151,7 @@ Cesium.PostProcessStageLibrary.createSilhouetteStage([ silhouetteBlue, silhouetteGreen, - ]), + ]) ); // Silhouette a feature blue on hover. diff --git a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html index 2098504bb378..4c3ce3ce1655 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html +++ b/Apps/Sandcastle/gallery/3D Tiles Feature Styling.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/3D Tiles Formats.html b/Apps/Sandcastle/gallery/3D Tiles Formats.html index f49fbd3af3fb..257586140b1d 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Formats.html +++ b/Apps/Sandcastle/gallery/3D Tiles Formats.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -160,8 +160,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) + ) ); const properties = tileset.properties; diff --git a/Apps/Sandcastle/gallery/3D Tiles Inspector.html b/Apps/Sandcastle/gallery/3D Tiles Inspector.html index 2a9ba14b51c6..7b0eb33f284d 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Inspector.html +++ b/Apps/Sandcastle/gallery/3D Tiles Inspector.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -52,7 +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 906d460ffeca..54b68e6946f8 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html +++ b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -92,12 +92,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 ); scene.camera.setView({ destination: initialPosition, @@ -194,10 +194,11 @@ const positionCartographic = new Cesium.Cartographic( longitude, latitude, - height * 0.5, + height * 0.5 + ); + const position = scene.globe.ellipsoid.cartographicToCartesian( + positionCartographic ); - const position = - scene.globe.ellipsoid.cartographicToCartesian(positionCartographic); const camera = scene.camera; const heading = camera.heading; @@ -222,17 +223,17 @@ pitch = Cesium.Math.clamp( pitch, -Cesium.Math.PI_OVER_TWO, - Cesium.Math.PI_OVER_TWO, + Cesium.Math.PI_OVER_TWO ); heading = Cesium.Math.zeroToTwoPi(heading) - Cesium.Math.PI_OVER_TWO; const pitchQuat = Cesium.Quaternion.fromAxisAngle( Cesium.Cartesian3.UNIT_Y, - -pitch, + -pitch ); const headingQuat = Cesium.Quaternion.fromAxisAngle( Cesium.Cartesian3.UNIT_Z, - -heading, + -heading ); const rotQuat = Cesium.Quaternion.multiply(headingQuat, pitchQuat, headingQuat); const rotMatrix = Cesium.Matrix3.fromQuaternion(rotQuat); diff --git a/Apps/Sandcastle/gallery/3D Tiles Interior.html b/Apps/Sandcastle/gallery/3D Tiles Interior.html index c16ce8b088c8..2417bdb31385 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Interior.html +++ b/Apps/Sandcastle/gallery/3D Tiles Interior.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,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 022a732726e6..9a321db3bc17 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry Classification.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,7 +51,7 @@ classificationTilesetUrl, { classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }, + } ); classificationTileset.style = new Cesium.Cesium3DTileStyle({ color: "rgba(255, 0, 0, 0.5)", @@ -63,7 +63,7 @@ classificationTilesetUrl, { show: false, - }, + } ); nonClassificationTileset.style = new Cesium.Cesium3DTileStyle({ color: "rgba(255, 0, 0, 0.5)", diff --git a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html index 598ee7e9ac69..ea1d8989f4b0 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html +++ b/Apps/Sandcastle/gallery/3D Tiles Photogrammetry.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html index fedb3b12bb33..d90d0b9edfc4 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -50,7 +50,7 @@ "../../SampleData/Cesium3DTiles/Classification/PointCloud/tileset.json", { classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }, + } ); viewer.scene.primitives.add(classificationTileset); @@ -75,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 ), }); diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html index 3d3dc2a6c10b..66bab5a4f390 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -186,12 +186,12 @@ 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, @@ -244,12 +244,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 ), }); @@ -296,8 +296,9 @@ .getObservable(viewModel, "geometricErrorScale") .subscribe(function (newValue) { if (Cesium.defined(viewModelTileset)) { - viewModelTileset.pointCloudShading.geometricErrorScale = - parseFloat(newValue); + viewModelTileset.pointCloudShading.geometricErrorScale = parseFloat( + newValue + ); } }); @@ -321,8 +322,9 @@ .getObservable(viewModel, "eyeDomeLightingStrength") .subscribe(function (newValue) { if (Cesium.defined(viewModelTileset)) { - viewModelTileset.pointCloudShading.eyeDomeLightingStrength = - parseFloat(newValue); + viewModelTileset.pointCloudShading.eyeDomeLightingStrength = parseFloat( + newValue + ); } }); @@ -330,8 +332,9 @@ .getObservable(viewModel, "eyeDomeLightingRadius") .subscribe(function (newValue) { if (Cesium.defined(viewModelTileset)) { - viewModelTileset.pointCloudShading.eyeDomeLightingRadius = - parseFloat(newValue); + viewModelTileset.pointCloudShading.eyeDomeLightingRadius = parseFloat( + newValue + ); } }); diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html index ce6466ae5692..416d6e837859 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html +++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Styling.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -39,7 +39,7 @@ let tileset; try { tileset = await Cesium.Cesium3DTileset.fromUrl( - "../../SampleData/Cesium3DTiles/PointCloud/PointCloudWithPerPointProperties/tileset.json", + "../../SampleData/Cesium3DTiles/PointCloud/PointCloudWithPerPointProperties/tileset.json" ); viewer.scene.primitives.add(tileset); viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -1.0, 50.0)); diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud.html index 1758260e7447..6c06a290c000 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud.html +++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,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 581814432c70..613c2d1bc432 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html +++ b/Apps/Sandcastle/gallery/3D Tiles Terrain Classification.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html b/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html index 4e636b2f001c..0fb2f717b8a6 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html +++ b/Apps/Sandcastle/gallery/3D Tiles Vertical Exaggeration.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -90,12 +90,12 @@ <h1>Loading...</h1> destination: new Cesium.Cartesian3( -2710292.813384663, -4360657.061518585, - 3793571.786860543, + 3793571.786860543 ), orientation: new Cesium.HeadingPitchRoll( 5.794062761901799, -0.30293409742984756, - 0.0009187098191985044, + 0.0009187098191985044 ), }); diff --git a/Apps/Sandcastle/gallery/AEC Clipping.html b/Apps/Sandcastle/gallery/AEC Clipping.html index 0fa60bf14964..6c275deabfd4 100644 --- a/Apps/Sandcastle/gallery/AEC Clipping.html +++ b/Apps/Sandcastle/gallery/AEC Clipping.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,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; @@ -66,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; @@ -74,7 +74,7 @@ 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) => { diff --git a/Apps/Sandcastle/gallery/Aerometrex San Francisco.html b/Apps/Sandcastle/gallery/Aerometrex San Francisco.html index 38ea645c9e3a..2b83396a46e7 100755 --- a/Apps/Sandcastle/gallery/Aerometrex San Francisco.html +++ b/Apps/Sandcastle/gallery/Aerometrex San Francisco.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -48,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, }); @@ -65,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 ), }); } @@ -81,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 ), }); } @@ -97,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 c6017addff93..20f0094aca54 100644 --- a/Apps/Sandcastle/gallery/Ambient Occlusion.html +++ b/Apps/Sandcastle/gallery/Ambient Occlusion.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -110,7 +110,7 @@ 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." ); } @@ -138,7 +138,7 @@ 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); @@ -152,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 2d02b7e7c5c9..75a7acd35698 100644 --- a/Apps/Sandcastle/gallery/ArcGIS MapServer.html +++ b/Apps/Sandcastle/gallery/ArcGIS MapServer.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,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 7b141571a260..708da69160a4 100644 --- a/Apps/Sandcastle/gallery/ArcGIS Tiled Elevation Terrain.html +++ b/Apps/Sandcastle/gallery/ArcGIS Tiled Elevation Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -32,10 +32,9 @@ 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 c9bad7bef52e..362d6e35825b 100644 --- a/Apps/Sandcastle/gallery/ArcticDEM.html +++ b/Apps/Sandcastle/gallery/ArcticDEM.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -37,8 +37,9 @@ 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}`); } @@ -53,7 +54,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.6399828792482234, 1.0993550795541742, - 5795, + 5795 ), orientation: { heading: 3.8455, @@ -70,7 +71,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.610708034601548, 1.0671172431736584, - 1900, + 1900 ), orientation: { heading: 4.6, @@ -87,7 +88,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.6928866820212813, 1.072394255273859, - 3700, + 3700 ), orientation: { heading: 1.6308222948889464, @@ -104,7 +105,7 @@ destination: Cesium.Cartesian3.fromRadians( -2.6395623497608596, 1.0976443174490356, - 2070, + 2070 ), orientation: { heading: 6.068794108659519, @@ -115,14 +116,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 1f2741655f23..196d727bf8a1 100644 --- a/Apps/Sandcastle/gallery/Atmosphere.html +++ b/Apps/Sandcastle/gallery/Atmosphere.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -634,7 +634,7 @@ globe.atmosphereLightIntensity = 20.0; viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2022-03-23T11:31:42.34200000000419095Z", + "2022-03-23T11:31:42.34200000000419095Z" ); const canvas = viewer.canvas; diff --git a/Apps/Sandcastle/gallery/Bathymetry.html b/Apps/Sandcastle/gallery/Bathymetry.html index 3a98117ed331..ee4942019d13 100644 --- a/Apps/Sandcastle/gallery/Bathymetry.html +++ b/Apps/Sandcastle/gallery/Bathymetry.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -119,12 +119,12 @@ scene.preRender.addEventListener(function (scene, time) { const surfaceNormal = globe.ellipsoid.geodeticSurfaceNormal( camera.positionWC, - scratchNormal, + scratchNormal ); const negativeNormal = Cesium.Cartesian3.negate(surfaceNormal, surfaceNormal); scene.light.direction = Cesium.Cartesian3.normalize( Cesium.Cartesian3.add(negativeNormal, camera.rightWC, surfaceNormal), - scene.light.direction, + scene.light.direction ); const zoomMagnitude = @@ -277,17 +277,15 @@ function (checked) { showElevationColorRamp = checked; updateGlobeMaterial(); - }, + } ); - Sandcastle.addToggleButton( - "Contour lines enabled", - showContourLines, - function (checked) { - showContourLines = checked; - updateGlobeMaterial(); - }, - ); + Sandcastle.addToggleButton("Contour lines enabled", showContourLines, function ( + checked + ) { + showContourLines = checked; + updateGlobeMaterial(); + }); Sandcastle.addToggleButton( "Invert contour line color", @@ -295,7 +293,7 @@ function (checked) { invertContourLines = checked; updateGlobeMaterial(); - }, + } ); // Vertical exaggeration @@ -322,12 +320,12 @@ destination: new Cesium.Cartesian3( -3877002.181627189, 5147948.256341475, - 864384.3423478723, + 864384.3423478723 ), orientation: new Cesium.HeadingPitchRoll( 5.914830423853524, -0.7139104486007932, - 0.00017507632714419685, + 0.00017507632714419685 ), }); diff --git a/Apps/Sandcastle/gallery/Billboards.html b/Apps/Sandcastle/gallery/Billboards.html index bc52b7898978..cb69ce4f0abc 100644 --- a/Apps/Sandcastle/gallery/Billboards.html +++ b/Apps/Sandcastle/gallery/Billboards.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -173,7 +173,7 @@ 1.0e3, 1.0, 1.5e6, - 0.0, + 0.0 ), translucencyByDistance: new Cesium.NearFarScalar(1.0e3, 1.0, 1.5e6, 0.1), }, @@ -257,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 f4c12739f24f..7161ffface77 100644 --- a/Apps/Sandcastle/gallery/Bing Maps Labels Only.html +++ b/Apps/Sandcastle/gallery/Bing Maps Labels Only.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -73,27 +73,27 @@ // Add Bing Maps Aerial with Labels to the left panel const bingMapsAerialWithLabels = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3), + Cesium.IonImageryProvider.fromAssetId(3) ); bingMapsAerialWithLabels.splitDirection = Cesium.SplitDirection.LEFT; layers.add(bingMapsAerialWithLabels); // Add Bing Maps Aerial (unlabeled) to the right panel const bingMapsAerial = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(2), + Cesium.IonImageryProvider.fromAssetId(2) ); bingMapsAerial.splitDirection = Cesium.SplitDirection.RIGHT; layers.add(bingMapsAerial); // Add high resolution Washington DC imagery to both panels. const imageryLayer = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3827), + Cesium.IonImageryProvider.fromAssetId(3827) ); viewer.imageryLayers.add(imageryLayer); // Add Bing Maps Labels Only to the right panel const bingMapsLabelsOnly = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(2411391), + Cesium.IonImageryProvider.fromAssetId(2411391) ); bingMapsLabelsOnly.splitDirection = Cesium.SplitDirection.RIGHT; // Only show to the left of the slider. layers.add(bingMapsLabelsOnly); diff --git a/Apps/Sandcastle/gallery/Bloom.html b/Apps/Sandcastle/gallery/Bloom.html index 25cbcc7fbde1..09b87b5f142b 100644 --- a/Apps/Sandcastle/gallery/Bloom.html +++ b/Apps/Sandcastle/gallery/Bloom.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -162,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 626a53cfdcd3..c20bad8ddb20 100644 --- a/Apps/Sandcastle/gallery/Blue Marble.html +++ b/Apps/Sandcastle/gallery/Blue Marble.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,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 52b433743102..a49a75c505d5 100644 --- a/Apps/Sandcastle/gallery/Box.html +++ b/Apps/Sandcastle/gallery/Box.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML 3D Tiles.html b/Apps/Sandcastle/gallery/CZML 3D Tiles.html index 9dbecfa905d6..ab75ce381e43 100644 --- a/Apps/Sandcastle/gallery/CZML 3D Tiles.html +++ b/Apps/Sandcastle/gallery/CZML 3D Tiles.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -49,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 e53cc0e30c51..d6fa6a4bbf23 100644 --- a/Apps/Sandcastle/gallery/CZML Billboard and Label.html +++ b/Apps/Sandcastle/gallery/CZML Billboard and Label.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Box.html b/Apps/Sandcastle/gallery/CZML Box.html index e5d8931c6256..161c33bcb8f3 100644 --- a/Apps/Sandcastle/gallery/CZML Box.html +++ b/Apps/Sandcastle/gallery/CZML Box.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html b/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html index d602d6e97ebc..854e2d26729a 100644 --- a/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html +++ b/Apps/Sandcastle/gallery/CZML Circles and Ellipses.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Colors.html b/Apps/Sandcastle/gallery/CZML Colors.html index 6e71fb0ecebd..04da5782a051 100644 --- a/Apps/Sandcastle/gallery/CZML Colors.html +++ b/Apps/Sandcastle/gallery/CZML Colors.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html b/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html index 56a80efcc87d..ce7c05897c70 100644 --- a/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html +++ b/Apps/Sandcastle/gallery/CZML Cones and Cylinders.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Corridor.html b/Apps/Sandcastle/gallery/CZML Corridor.html index c603188156df..991254e3ca03 100644 --- a/Apps/Sandcastle/gallery/CZML Corridor.html +++ b/Apps/Sandcastle/gallery/CZML Corridor.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Custom Properties.html b/Apps/Sandcastle/gallery/CZML Custom Properties.html index b20add92fe4e..c9b1d5de7e12 100644 --- a/Apps/Sandcastle/gallery/CZML Custom Properties.html +++ b/Apps/Sandcastle/gallery/CZML Custom Properties.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -88,7 +88,18 @@ 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: { @@ -123,7 +134,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"); @@ -153,7 +164,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 10de6e4428fe..d43c75192172 100644 --- a/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html +++ b/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -57,19 +57,32 @@ 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, ], }, }, @@ -83,7 +96,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 39d5206b6b63..6aea025ed8a8 100644 --- a/Apps/Sandcastle/gallery/CZML Model Articulations.html +++ b/Apps/Sandcastle/gallery/CZML Model Articulations.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -79,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 88c54c659a2f..3e69fd854a2c 100644 --- a/Apps/Sandcastle/gallery/CZML Model Data URL.html +++ b/Apps/Sandcastle/gallery/CZML Model Data URL.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -68,7 +68,8 @@ { 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: [ @@ -156,7 +157,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 ea0b1e03609a..53c76e91d4cc 100644 --- a/Apps/Sandcastle/gallery/CZML Model.html +++ b/Apps/Sandcastle/gallery/CZML Model.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -55,7 +55,7 @@ }); const dataSourcePromise = viewer.dataSources.add( - Cesium.CzmlDataSource.load(czml), + Cesium.CzmlDataSource.load(czml) ); dataSourcePromise diff --git a/Apps/Sandcastle/gallery/CZML Path.html b/Apps/Sandcastle/gallery/CZML Path.html index 99f234cefcf4..186f19ea288b 100644 --- a/Apps/Sandcastle/gallery/CZML Path.html +++ b/Apps/Sandcastle/gallery/CZML Path.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -75,898 +75,7166 @@ 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, ], }, }, diff --git a/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html b/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html index 566470ba6ad7..e53fe99701a4 100644 --- a/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html +++ b/Apps/Sandcastle/gallery/CZML Point - Time Dynamic.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,8 +42,22 @@ 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 ef7f716fc992..abd42ce6638c 100644 --- a/Apps/Sandcastle/gallery/CZML Point.html +++ b/Apps/Sandcastle/gallery/CZML Point.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html b/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html index 70eb956375c5..7feaf186baad 100644 --- a/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html +++ b/Apps/Sandcastle/gallery/CZML Polygon - Interpolating References.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -69,8 +69,30 @@ 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, ], }, }, @@ -89,8 +111,22 @@ 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, ], }, }, diff --git a/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html b/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html index 7dd4454542ee..3aa665cc69f0 100644 --- a/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html +++ b/Apps/Sandcastle/gallery/CZML Polygon - Intervals, Availability.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -92,9 +92,39 @@ 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: { @@ -115,8 +145,33 @@ 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 46863d48dbb3..dbd7190dbe32 100644 --- a/Apps/Sandcastle/gallery/CZML Polygon.html +++ b/Apps/Sandcastle/gallery/CZML Polygon.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,8 +42,21 @@ 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: { @@ -99,8 +112,18 @@ 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: { @@ -124,7 +147,18 @@ 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: { diff --git a/Apps/Sandcastle/gallery/CZML Polyline Volume.html b/Apps/Sandcastle/gallery/CZML Polyline Volume.html index 9822d819e94b..6445a447b18c 100644 --- a/Apps/Sandcastle/gallery/CZML Polyline Volume.html +++ b/Apps/Sandcastle/gallery/CZML Polyline Volume.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,7 +42,15 @@ 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: { @@ -68,19 +76,46 @@ 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 31fbc7d75553..fce7be652548 100644 --- a/Apps/Sandcastle/gallery/CZML Polyline.html +++ b/Apps/Sandcastle/gallery/CZML Polyline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Position Definitions.html b/Apps/Sandcastle/gallery/CZML Position Definitions.html index 357553c9490c..5a3109085531 100644 --- a/Apps/Sandcastle/gallery/CZML Position Definitions.html +++ b/Apps/Sandcastle/gallery/CZML Position Definitions.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Rectangle.html b/Apps/Sandcastle/gallery/CZML Rectangle.html index a7b1478f6069..6552ba40a0c8 100644 --- a/Apps/Sandcastle/gallery/CZML Rectangle.html +++ b/Apps/Sandcastle/gallery/CZML Rectangle.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Reference Properties.html b/Apps/Sandcastle/gallery/CZML Reference Properties.html index d2723f81d0e7..53ccefa7f151 100644 --- a/Apps/Sandcastle/gallery/CZML Reference Properties.html +++ b/Apps/Sandcastle/gallery/CZML Reference Properties.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -95,8 +95,21 @@ 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 45d83934b788..0aa16cbbfba9 100644 --- a/Apps/Sandcastle/gallery/CZML Spheres and Ellipsoids.html +++ b/Apps/Sandcastle/gallery/CZML Spheres and Ellipsoids.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/CZML Wall.html b/Apps/Sandcastle/gallery/CZML Wall.html index b900b2418918..af52f588fc62 100644 --- a/Apps/Sandcastle/gallery/CZML Wall.html +++ b/Apps/Sandcastle/gallery/CZML Wall.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,10 +41,39 @@ 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 5648851973a7..36b6cff11261 100644 --- a/Apps/Sandcastle/gallery/CZML ZIndex.html +++ b/Apps/Sandcastle/gallery/CZML ZIndex.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -79,8 +79,21 @@ 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 895ff23bad72..42e08f106efe 100644 --- a/Apps/Sandcastle/gallery/CZML.html +++ b/Apps/Sandcastle/gallery/CZML.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -39,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); @@ -47,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 272509b8b934..a656860e3bac 100644 --- a/Apps/Sandcastle/gallery/Callback Position Property.html +++ b/Apps/Sandcastle/gallery/Callback Position Property.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -52,7 +52,7 @@ const stop = Cesium.JulianDate.addSeconds( start, duration, - new Cesium.JulianDate(), + new Cesium.JulianDate() ); // Make sure viewer is at the desired time. @@ -92,12 +92,12 @@ 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. @@ -183,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 bd7fba4636ad..e0f7f7dbfcaa 100644 --- a/Apps/Sandcastle/gallery/Callback Property.html +++ b/Apps/Sandcastle/gallery/Callback Property.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -56,7 +56,7 @@ return Cesium.Cartesian3.fromDegreesArray( [startLongitude, startLatitude, endLongitude, startLatitude], Cesium.Ellipsoid.WGS84, - result, + result ); }, isConstant), width: 5, @@ -66,7 +66,7 @@ const startCartographic = Cesium.Cartographic.fromDegrees( startLongitude, - startLatitude, + startLatitude ); // use scratch object to avoid new allocations per frame. @@ -94,7 +94,7 @@ 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 34002df723d6..f1631845d383 100644 --- a/Apps/Sandcastle/gallery/Camera Tutorial.html +++ b/Apps/Sandcastle/gallery/Camera Tutorial.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -123,7 +123,7 @@ flags[flagName] = true; } }, - false, + false ); document.addEventListener( @@ -134,7 +134,7 @@ flags[flagName] = false; } }, - false, + false ); viewer.clock.onTick.addEventListener(function (clock) { diff --git a/Apps/Sandcastle/gallery/Camera.html b/Apps/Sandcastle/gallery/Camera.html index 84b8a2838ad9..932c7ec39744 100644 --- a/Apps/Sandcastle/gallery/Camera.html +++ b/Apps/Sandcastle/gallery/Camera.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -75,7 +75,7 @@ destination: Cesium.Cartesian3.fromDegrees( position.coords.longitude, position.coords.latitude, - 1000.0, + 1000.0 ), }); } @@ -143,7 +143,7 @@ camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z; camera.lookAtTransform( transform, - new Cesium.Cartesian3(-120000.0, -120000.0, 120000.0), + new Cesium.Cartesian3(-120000.0, -120000.0, 120000.0) ); // Show reference frame. Not required. @@ -151,7 +151,7 @@ new Cesium.DebugModelMatrixPrimitive({ modelMatrix: transform, length: 100000.0, - }), + }) ); } @@ -233,7 +233,7 @@ destination: Cesium.Cartesian3.fromDegrees( -73.98580932617188, 40.74843406689482, - 363.34038727246224, + 363.34038727246224 ), complete: function () { setTimeout(function () { @@ -241,7 +241,7 @@ destination: Cesium.Cartesian3.fromDegrees( -73.98585975679403, 40.75759944127251, - 186.50838555841779, + 186.50838555841779 ), orientation: { heading: Cesium.Math.toRadians(200.0), diff --git a/Apps/Sandcastle/gallery/Cardboard.html b/Apps/Sandcastle/gallery/Cardboard.html index 1cb40c83d087..9f7280100a5a 100644 --- a/Apps/Sandcastle/gallery/Cardboard.html +++ b/Apps/Sandcastle/gallery/Cardboard.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -66,12 +66,12 @@ 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); } @@ -126,7 +126,7 @@ transform = Cesium.Matrix4.fromRotationTranslation( Cesium.Matrix3.fromQuaternion(orientation), - position, + position ); } diff --git a/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html index 8e2e0bddff6c..1a9495b9e5ef 100644 --- a/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html +++ b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -44,7 +44,7 @@ -180.0, -23.43687, 180.0, - 23.43687, + 23.43687 ); globe.cartographicLimitRectangle = coffeeBeltRectangle; @@ -67,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 670a90acb21a..199e7c4f021c 100644 --- a/Apps/Sandcastle/gallery/Cesium Inspector.html +++ b/Apps/Sandcastle/gallery/Cesium Inspector.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -56,21 +56,21 @@ }), 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( @@ -86,7 +86,7 @@ }, }), appearance: new Cesium.PerInstanceColorAppearance(), - }), + }) ); const billboards = scene.primitives.add(new Cesium.BillboardCollection()); diff --git a/Apps/Sandcastle/gallery/Cesium OSM Buildings.html b/Apps/Sandcastle/gallery/Cesium OSM Buildings.html index a71b89836518..8b62f87444bd 100755 --- a/Apps/Sandcastle/gallery/Cesium OSM Buildings.html +++ b/Apps/Sandcastle/gallery/Cesium OSM Buildings.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Cesium Widget.html b/Apps/Sandcastle/gallery/Cesium Widget.html index ab81249db25b..88da4d9c5b1c 100644 --- a/Apps/Sandcastle/gallery/Cesium Widget.html +++ b/Apps/Sandcastle/gallery/Cesium Widget.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Cesium World Terrain.html b/Apps/Sandcastle/gallery/Cesium World Terrain.html index 2f1043fb76c2..a03034418426 100644 --- a/Apps/Sandcastle/gallery/Cesium World Terrain.html +++ b/Apps/Sandcastle/gallery/Cesium World Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -39,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 9e43d7bde003..30351329a9f4 100644 --- a/Apps/Sandcastle/gallery/Circles and Ellipses.html +++ b/Apps/Sandcastle/gallery/Circles and Ellipses.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Clamp Entities to Ground.html b/Apps/Sandcastle/gallery/Clamp Entities to Ground.html index 0a048fbe0d93..50412adaa7ca 100644 --- a/Apps/Sandcastle/gallery/Clamp Entities to Ground.html +++ b/Apps/Sandcastle/gallery/Clamp Entities to Ground.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -142,7 +142,12 @@ 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), @@ -163,22 +168,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 ), ], }, @@ -194,7 +199,7 @@ onselect: function () { 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; } @@ -207,22 +212,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 ), ], }, @@ -277,7 +282,12 @@ 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, @@ -292,12 +302,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 130491a4254d..b6864dc6d8ce 100644 --- a/Apps/Sandcastle/gallery/Clamp Model to Ground.html +++ b/Apps/Sandcastle/gallery/Clamp Model to Ground.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,7 +46,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3193669086512454, 0.698810888305128, - 220, + 220 ), orientation: { heading: -1.3, @@ -69,7 +69,7 @@ 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"); @@ -156,7 +156,7 @@ 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 968f91b28fff..78d7cbf7beb5 100644 --- a/Apps/Sandcastle/gallery/Clamp to 3D Model.html +++ b/Apps/Sandcastle/gallery/Clamp to 3D Model.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -100,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 5c3564ed29d7..085eb20c065d 100644 --- a/Apps/Sandcastle/gallery/Classification Types.html +++ b/Apps/Sandcastle/gallery/Classification Types.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,7 +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) { @@ -54,10 +54,15 @@ 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, @@ -67,13 +72,28 @@ 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({ @@ -123,7 +143,7 @@ onselect: function () { 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 462a5dd14b66..cc0dce4a0bec 100644 --- a/Apps/Sandcastle/gallery/Classification.html +++ b/Apps/Sandcastle/gallery/Classification.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -83,15 +83,15 @@ let center = new Cesium.Cartesian3( 1216389.3637977627, -4736323.641980423, - 4081321.7428341154, + 4081321.7428341154 ); let modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); let hprRotation = Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(2.619728786416368, 0.0, 0.0), + new Cesium.HeadingPitchRoll(2.619728786416368, 0.0, 0.0) ); let hpr = Cesium.Matrix4.fromRotationTranslation( hprRotation, - new Cesium.Cartesian3(0.0, 0.0, -2.0), + new Cesium.Cartesian3(0.0, 0.0, -2.0) ); Cesium.Matrix4.multiply(modelMatrix, hpr, modelMatrix); @@ -105,28 +105,28 @@ modelMatrix: modelMatrix, 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) ), show: new Cesium.ShowGeometryInstanceAttribute(true), }, id: "volume", }), classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }), + }) ); center = new Cesium.Cartesian3( 1216409.0189737265, -4736252.144235287, - 4081393.6027081604, + 4081393.6027081604 ); modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); hprRotation = Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(5.785339046755887, 0.0, 0.0), + new Cesium.HeadingPitchRoll(5.785339046755887, 0.0, 0.0) ); hpr = Cesium.Matrix4.fromRotationTranslation( hprRotation, - new Cesium.Cartesian3(0.4, 0.0, -2.0), + new Cesium.Cartesian3(0.4, 0.0, -2.0) ); Cesium.Matrix4.multiply(modelMatrix, hpr, modelMatrix); @@ -139,28 +139,28 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#F26419").withAlpha(0.5), + Cesium.Color.fromCssColorString("#F26419").withAlpha(0.5) ), show: new Cesium.ShowGeometryInstanceAttribute(true), }, id: "volume 1", }), classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }), + }) ); center = new Cesium.Cartesian3( 1216404.8844045496, -4736255.287065536, - 4081392.010192471, + 4081392.010192471 ); modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); hprRotation = Cesium.Matrix3.fromHeadingPitchRoll( - new Cesium.HeadingPitchRoll(5.785339046755887, 0.0, 0.0), + new Cesium.HeadingPitchRoll(5.785339046755887, 0.0, 0.0) ); hpr = Cesium.Matrix4.fromRotationTranslation( hprRotation, - new Cesium.Cartesian3(-0.25, 0.0, -2.0), + new Cesium.Cartesian3(-0.25, 0.0, -2.0) ); Cesium.Matrix4.multiply(modelMatrix, hpr, modelMatrix); @@ -173,24 +173,24 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#F03A47").withAlpha(0.5), + Cesium.Color.fromCssColorString("#F03A47").withAlpha(0.5) ), show: new Cesium.ShowGeometryInstanceAttribute(true), }, id: "volume 2", }), classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }), + }) ); center = new Cesium.Cartesian3( 1216398.813990024, -4736258.039875737, - 4081387.9562678365, + 4081387.9562678365 ); modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); let translation = Cesium.Matrix4.fromTranslation( - new Cesium.Cartesian3(0.0, 0.0, -2.0), + new Cesium.Cartesian3(0.0, 0.0, -2.0) ); Cesium.Matrix4.multiply(modelMatrix, translation, modelMatrix); @@ -203,24 +203,24 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#004FFF").withAlpha(0.5), + Cesium.Color.fromCssColorString("#004FFF").withAlpha(0.5) ), show: new Cesium.ShowGeometryInstanceAttribute(true), }, id: "volume 3", }), classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }), + }) ); center = new Cesium.Cartesian3( 1216393.6257790313, -4736259.809075361, - 4081384.4858198245, + 4081384.4858198245 ); modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); translation = Cesium.Matrix4.fromTranslation( - new Cesium.Cartesian3(0.0, 0.0, -1.0), + new Cesium.Cartesian3(0.0, 0.0, -1.0) ); Cesium.Matrix4.multiply(modelMatrix, translation, modelMatrix); @@ -233,14 +233,14 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#55DDE0").withAlpha(0.5), + Cesium.Color.fromCssColorString("#55DDE0").withAlpha(0.5) ), show: new Cesium.ShowGeometryInstanceAttribute(true), }, id: "volume 4", }), classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, - }), + }) ); function highlightBuilding() { @@ -248,7 +248,7 @@ destination: new Cesium.Cartesian3( 1216394.1392207467, -4736348.59346919, - 4081293.9160685353, + 4081293.9160685353 ), orientation: { heading: 0.018509338875732695, @@ -262,7 +262,7 @@ destination: new Cesium.Cartesian3( 1216435.0352745096, -4736283.144192113, - 4081368.0920420634, + 4081368.0920420634 ), orientation: { heading: 5.718380792746039, @@ -279,16 +279,21 @@ scene.invertClassification = checked; scene.invertClassificationColor = new Cesium.Color(0.25, 0.25, 0.25, 1.0); - buildingHighlight.getGeometryInstanceAttributes("volume").show = - Cesium.ShowGeometryInstanceAttribute.toValue(!checked); - treeHighlight1.getGeometryInstanceAttributes("volume 1").show = - Cesium.ShowGeometryInstanceAttribute.toValue(!checked); - treeHighlight2.getGeometryInstanceAttributes("volume 2").show = - Cesium.ShowGeometryInstanceAttribute.toValue(!checked); - treeHighlight3.getGeometryInstanceAttributes("volume 3").show = - Cesium.ShowGeometryInstanceAttribute.toValue(!checked); - treeHighlight4.getGeometryInstanceAttributes("volume 4").show = - Cesium.ShowGeometryInstanceAttribute.toValue(!checked); + buildingHighlight.getGeometryInstanceAttributes( + "volume" + ).show = Cesium.ShowGeometryInstanceAttribute.toValue(!checked); + treeHighlight1.getGeometryInstanceAttributes( + "volume 1" + ).show = Cesium.ShowGeometryInstanceAttribute.toValue(!checked); + treeHighlight2.getGeometryInstanceAttributes( + "volume 2" + ).show = Cesium.ShowGeometryInstanceAttribute.toValue(!checked); + treeHighlight3.getGeometryInstanceAttributes( + "volume 3" + ).show = Cesium.ShowGeometryInstanceAttribute.toValue(!checked); + treeHighlight4.getGeometryInstanceAttributes( + "volume 4" + ).show = Cesium.ShowGeometryInstanceAttribute.toValue(!checked); } function updateAlpha(value) { @@ -333,8 +338,9 @@ } if (Cesium.defined(currentObjectId)) { - attributes = - currentPrimitive.getGeometryInstanceAttributes(currentObjectId); + attributes = currentPrimitive.getGeometryInstanceAttributes( + currentObjectId + ); attributes.color = currentColor; attributes.show = currentShow; currentObjectId = undefined; diff --git a/Apps/Sandcastle/gallery/Clipping Regions.html b/Apps/Sandcastle/gallery/Clipping Regions.html index 97dba26b3ce9..1f69febf2754 100644 --- a/Apps/Sandcastle/gallery/Clipping Regions.html +++ b/Apps/Sandcastle/gallery/Clipping Regions.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -81,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); @@ -103,7 +103,7 @@ [-105.00715641889735, 39.751312128419926], [-105.00715641889735, 39.75135429046085], [-105.0077102972673, 39.75198671798765], - ].flat(2), + ].flat(2) ), }), ]; @@ -153,20 +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({ @@ -183,7 +183,7 @@ polygon: { hierarchy: positionData, material: new Cesium.ColorMaterialProperty( - Cesium.Color.WHITE.withAlpha(0.7), + Cesium.Color.WHITE.withAlpha(0.7) ), }, }); @@ -236,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 31b0bacaaf32..1ee69685e109 100644 --- a/Apps/Sandcastle/gallery/Clock.html +++ b/Apps/Sandcastle/gallery/Clock.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Cloud Parameters.html b/Apps/Sandcastle/gallery/Cloud Parameters.html index c1041be59629..917c0c141093 100644 --- a/Apps/Sandcastle/gallery/Cloud Parameters.html +++ b/Apps/Sandcastle/gallery/Cloud Parameters.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -166,7 +166,7 @@ new Cesium.CloudCollection({ noiseDetail: 16.0, noiseOffset: Cesium.Cartesian3.ZERO, - }), + }) ); const cloudParameters = { @@ -189,7 +189,7 @@ maximumSize: new Cesium.Cartesian3( cloudParameters.maximumSizeX, cloudParameters.maximumSizeY, - cloudParameters.maximumSizeZ, + cloudParameters.maximumSizeZ ), color: getColor(cloudParameters.color), slice: cloudParameters.renderSlice ? cloudParameters.slice : -1.0, @@ -230,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); @@ -244,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); @@ -258,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 1cc6fb17d3b2..462303e522fd 100644 --- a/Apps/Sandcastle/gallery/Clouds.html +++ b/Apps/Sandcastle/gallery/Clouds.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -112,7 +112,7 @@ startLat, stopLat, minHeight, - maxHeight, + maxHeight ) { const rangeLong = stopLong - startLong; const rangeLat = stopLat - startLat; @@ -132,7 +132,7 @@ maximumSize: new Cesium.Cartesian3( aspectRatio * cloudHeight, cloudHeight, - depth, + depth ), slice: slice, }); diff --git a/Apps/Sandcastle/gallery/Clustering.html b/Apps/Sandcastle/gallery/Clustering.html index a555999067c6..886c5f93246d 100644 --- a/Apps/Sandcastle/gallery/Clustering.html +++ b/Apps/Sandcastle/gallery/Clustering.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -79,8 +79,8 @@ const dataSourcePromise = viewer.dataSources.add( Cesium.KmlDataSource.load( "../../SampleData/kml/facilities/facilities.kml", - options, - ), + options + ) ); dataSourcePromise.then(function (dataSource) { const pixelRange = 15; @@ -133,7 +133,7 @@ cluster.billboard.image = singleDigitPins[clusteredEntities.length - 2]; } - }, + } ); } diff --git a/Apps/Sandcastle/gallery/Corridor.html b/Apps/Sandcastle/gallery/Corridor.html index 9c3f64cdd1b6..390bd5d1802e 100644 --- a/Apps/Sandcastle/gallery/Corridor.html +++ b/Apps/Sandcastle/gallery/Corridor.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,7 +35,12 @@ 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), @@ -46,7 +51,12 @@ 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, @@ -60,7 +70,12 @@ 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 befe14976721..bbceaca79cb2 100644 --- a/Apps/Sandcastle/gallery/Custom DataSource.html +++ b/Apps/Sandcastle/gallery/Custom DataSource.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -319,12 +319,12 @@ 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. diff --git a/Apps/Sandcastle/gallery/Custom Geocoder.html b/Apps/Sandcastle/gallery/Custom Geocoder.html index 91c7bdbf0016..cc5b41775547 100644 --- a/Apps/Sandcastle/gallery/Custom Geocoder.html +++ b/Apps/Sandcastle/gallery/Custom Geocoder.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -75,7 +75,7 @@ bboxDegrees[2], bboxDegrees[0], bboxDegrees[3], - bboxDegrees[1], + bboxDegrees[1] ), }; }); diff --git a/Apps/Sandcastle/gallery/Custom Per-Feature Post Process.html b/Apps/Sandcastle/gallery/Custom Per-Feature Post Process.html index d08090d9378d..a270dadebd97 100644 --- a/Apps/Sandcastle/gallery/Custom Per-Feature Post Process.html +++ b/Apps/Sandcastle/gallery/Custom Per-Feature Post Process.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -68,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 39f5450cb271..fb525ccdf7d6 100644 --- a/Apps/Sandcastle/gallery/Custom Post Process.html +++ b/Apps/Sandcastle/gallery/Custom Post Process.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -66,7 +66,7 @@ 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 459f9eb890c5..81011398d14c 100644 --- a/Apps/Sandcastle/gallery/Custom Shaders 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Custom Shaders 3D Tiles.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -63,12 +63,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, diff --git a/Apps/Sandcastle/gallery/Custom Shaders Models.html b/Apps/Sandcastle/gallery/Custom Shaders Models.html index d58a2b188632..9bf81e62838f 100644 --- a/Apps/Sandcastle/gallery/Custom Shaders Models.html +++ b/Apps/Sandcastle/gallery/Custom Shaders Models.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -44,7 +44,7 @@ }); viewer.clock.currentTime = Cesium.JulianDate.fromIso8601( - "2021-11-09T20:27:37.016064475348684937Z", + "2021-11-09T20:27:37.016064475348684937Z" ); // Model positioning =============================================== @@ -53,7 +53,7 @@ const hpr = new Cesium.HeadingPitchRoll(0, 0, 0); const fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator( "north", - "west", + "west" ); // Custom Shader Definitions ======================================== @@ -394,9 +394,9 @@ position, hpr, Cesium.Ellipsoid.WGS84, - fixedFrameTransform, + fixedFrameTransform ), - }), + }) ); const removeListener = model.readyEvent.addEventListener(() => { @@ -452,7 +452,7 @@ const drag = Cesium.Cartesian3.subtract( movement.endPosition, dragCenter, - scratchDrag, + scratchDrag ); // Update uniforms diff --git a/Apps/Sandcastle/gallery/Custom Shaders Property Textures.html b/Apps/Sandcastle/gallery/Custom Shaders Property Textures.html index 37efe139d9a4..3860b5f40c50 100644 --- a/Apps/Sandcastle/gallery/Custom Shaders Property Textures.html +++ b/Apps/Sandcastle/gallery/Custom Shaders Property Textures.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Cylinders and Cones.html b/Apps/Sandcastle/gallery/Cylinders and Cones.html index 72375fd294dd..d4fb591f7b9f 100644 --- a/Apps/Sandcastle/gallery/Cylinders and Cones.html +++ b/Apps/Sandcastle/gallery/Cylinders and Cones.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/DataSource Ordering.html b/Apps/Sandcastle/gallery/DataSource Ordering.html index 45fa783c0f6c..24185aeba734 100644 --- a/Apps/Sandcastle/gallery/DataSource Ordering.html +++ b/Apps/Sandcastle/gallery/DataSource Ordering.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Depth of Field.html b/Apps/Sandcastle/gallery/Depth of Field.html index 10ba3add6271..5dd5b71429a2 100644 --- a/Apps/Sandcastle/gallery/Depth of Field.html +++ b/Apps/Sandcastle/gallery/Depth of Field.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -134,7 +134,7 @@ } const depthOfField = viewer.scene.postProcessStages.add( - Cesium.PostProcessStageLibrary.createDepthOfFieldStage(), + Cesium.PostProcessStageLibrary.createDepthOfFieldStage() ); function updatePostProcess() { @@ -149,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 7567770cdedb..b0c49b232560 100644 --- a/Apps/Sandcastle/gallery/Distance Display Conditions.html +++ b/Apps/Sandcastle/gallery/Distance Display Conditions.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Drawing on Terrain.html b/Apps/Sandcastle/gallery/Drawing on Terrain.html index 70bb8e0c92bb..49894b349e19 100644 --- a/Apps/Sandcastle/gallery/Drawing on Terrain.html +++ b/Apps/Sandcastle/gallery/Drawing on Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -50,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({ @@ -79,7 +79,7 @@ polygon: { hierarchy: positionData, material: new Cesium.ColorMaterialProperty( - Cesium.Color.WHITE.withAlpha(0.7), + Cesium.Color.WHITE.withAlpha(0.7) ), }, }); @@ -163,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 e3d14bafc1bf..a95fa39c5ddb 100644 --- a/Apps/Sandcastle/gallery/Earth at Night.html +++ b/Apps/Sandcastle/gallery/Earth at Night.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,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) ), }); @@ -47,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); @@ -64,13 +64,11 @@ updateLighting(dynamicLighting); - Sandcastle.addToggleButton( - "Dynamic lighting", - dynamicLighting, - function (checked) { - updateLighting(checked); - }, - ); + Sandcastle.addToggleButton("Dynamic lighting", dynamicLighting, function ( + checked + ) { + updateLighting(checked); + }); //Sandcastle_End }; if (typeof Cesium !== "undefined") { diff --git a/Apps/Sandcastle/gallery/Elevation Band Material.html b/Apps/Sandcastle/gallery/Elevation Band Material.html index 1d0c8c552817..771e4730c438 100644 --- a/Apps/Sandcastle/gallery/Elevation Band Material.html +++ b/Apps/Sandcastle/gallery/Elevation Band Material.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -122,7 +122,7 @@ destination: new Cesium.Cartesian3( 290637.5534733206, 5637471.593707632, - 2978256.8126927214, + 2978256.8126927214 ), orientation: { heading: 4.747266966349747, diff --git a/Apps/Sandcastle/gallery/Export KML.html b/Apps/Sandcastle/gallery/Export KML.html index 242a6407ca34..6a7bee346ce1 100644 --- a/Apps/Sandcastle/gallery/Export KML.html +++ b/Apps/Sandcastle/gallery/Export KML.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -111,7 +111,7 @@ reset(); filenameToSave = "Satellites.kmz"; dataSourcePromise = Cesium.CzmlDataSource.load( - "../../SampleData/simple.czml", + "../../SampleData/simple.czml" ); viewer.dataSources.add(dataSourcePromise); @@ -130,7 +130,7 @@ }, }, ], - "propertiesMenu", + "propertiesMenu" ); Sandcastle.addToolbarButton("Download", function () { diff --git a/Apps/Sandcastle/gallery/FXAA.html b/Apps/Sandcastle/gallery/FXAA.html index 8fcb8d2b06ee..f454f27c60e1 100644 --- a/Apps/Sandcastle/gallery/FXAA.html +++ b/Apps/Sandcastle/gallery/FXAA.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -37,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 8896ca04c059..4baffa1732f9 100644 --- a/Apps/Sandcastle/gallery/Fog Post Process.html +++ b/Apps/Sandcastle/gallery/Fog Post Process.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -33,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, }); @@ -93,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 6380c10f015a..05c87d8d7f1b 100755 --- a/Apps/Sandcastle/gallery/GPX.html +++ b/Apps/Sandcastle/gallery/GPX.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,7 +46,7 @@ .add( Cesium.GpxDataSource.load("../../SampleData/gpx/lamina.gpx", { clampToGround: true, - }), + }) ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -60,7 +60,7 @@ .add( Cesium.GpxDataSource.load("../../SampleData/gpx/route.gpx", { clampToGround: true, - }), + }) ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -74,7 +74,7 @@ .add( Cesium.GpxDataSource.load("../../SampleData/gpx/wpt.gpx", { clampToGround: true, - }), + }) ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -88,7 +88,7 @@ .add( Cesium.GpxDataSource.load("../../SampleData/gpx/complexTrk.gpx", { clampToGround: true, - }), + }) ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -106,9 +106,9 @@ waypointImage: pinBuilder.fromMakiIconId( "bicycle", Cesium.Color.BLUE, - 48, + 48 ), - }), + }) ) .then(function (dataSource) { viewer.zoomTo(dataSource.entities); @@ -116,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 b4f6c76e5e72..930b2e667afa 100644 --- a/Apps/Sandcastle/gallery/GeoJSON and TopoJSON.html +++ b/Apps/Sandcastle/gallery/GeoJSON and TopoJSON.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -37,7 +37,7 @@ //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") ); }); @@ -48,7 +48,7 @@ stroke: Cesium.Color.HOTPINK, fill: Cesium.Color.PINK.withAlpha(0.5), strokeWidth: 3, - }), + }) ); }); @@ -58,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) { @@ -106,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 4d2449862f8d..3ee0cbfad8d2 100644 --- a/Apps/Sandcastle/gallery/GeoJSON simplestyle.html +++ b/Apps/Sandcastle/gallery/GeoJSON simplestyle.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,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 247787e4a6d1..9134e34b78b9 100644 --- a/Apps/Sandcastle/gallery/Geometry Height Reference.html +++ b/Apps/Sandcastle/gallery/Geometry Height Reference.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -162,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 77eed74eff32..5c46e81ce62b 100644 --- a/Apps/Sandcastle/gallery/Geometry and Appearances.html +++ b/Apps/Sandcastle/gallery/Geometry and Appearances.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -61,8 +61,17 @@ 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, @@ -130,8 +139,15 @@ 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, @@ -147,8 +163,15 @@ 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, @@ -199,7 +222,12 @@ 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], @@ -221,22 +249,50 @@ 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, ]), }, ], @@ -295,8 +351,17 @@ 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 }), @@ -308,8 +373,15 @@ 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, @@ -391,8 +463,21 @@ 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), @@ -403,7 +488,12 @@ 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 }), @@ -413,7 +503,12 @@ 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, @@ -425,7 +520,12 @@ 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, @@ -443,7 +543,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); } @@ -453,7 +553,15 @@ 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, @@ -466,7 +574,12 @@ 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 }), @@ -480,8 +593,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians), - ), + radius * Math.sin(radians) + ) ); } return positions; @@ -490,7 +603,12 @@ 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 0deb07a51e34..22ca69e52ed7 100644 --- a/Apps/Sandcastle/gallery/Globe Interior.html +++ b/Apps/Sandcastle/gallery/Globe Interior.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -71,7 +71,7 @@ -120.0, 0.0, -30.0, - 45.0, + 45.0 ); } @@ -103,7 +103,7 @@ radii: new Cesium.Cartesian3( innerCoreRadius, innerCoreRadius, - innerCoreRadius, + innerCoreRadius ), material: Cesium.Color.YELLOW, }, @@ -116,7 +116,7 @@ radii: new Cesium.Cartesian3( outerCoreRadius, outerCoreRadius, - outerCoreRadius, + outerCoreRadius ), material: Cesium.Color.ORANGE, }, 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 06910c978201..40121c0bdde9 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -110,12 +110,12 @@ scene.preRender.addEventListener(function (scene, time) { const surfaceNormal = globe.ellipsoid.geodeticSurfaceNormal( scene.camera.positionWC, - scratchNormal, + 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, + scene.light.direction ); }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Globe Materials.html b/Apps/Sandcastle/gallery/Globe Materials.html index ea2551357a80..0a2bb14e6ef4 100644 --- a/Apps/Sandcastle/gallery/Globe Materials.html +++ b/Apps/Sandcastle/gallery/Globe Materials.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -329,7 +329,7 @@ destination: new Cesium.Cartesian3( 322100.7492728492, 5917960.047024654, - 3077602.646977297, + 3077602.646977297 ), orientation: { heading: 5.988151498702285, @@ -337,8 +337,9 @@ roll: 0, }, }); - viewer.clockViewModel.currentTime = - Cesium.JulianDate.fromIso8601("2017-09-22T04:00:00Z"); + viewer.clockViewModel.currentTime = Cesium.JulianDate.fromIso8601( + "2017-09-22T04:00:00Z" + ); }, }, { @@ -348,7 +349,7 @@ destination: new Cesium.Cartesian3( -2495709.521843174, -4391600.804712465, - 3884463.7192916023, + 3884463.7192916023 ), orientation: { heading: 1.7183056487769202, @@ -356,8 +357,9 @@ roll: 0.0079181631783527, }, }); - viewer.clockViewModel.currentTime = - Cesium.JulianDate.fromIso8601("2017-09-22T18:00:00Z"); + viewer.clockViewModel.currentTime = Cesium.JulianDate.fromIso8601( + "2017-09-22T18:00:00Z" + ); }, }, { @@ -367,7 +369,7 @@ destination: new Cesium.Cartesian3( -2301222.367751603, -3485269.915771613, - 4812080.961755785, + 4812080.961755785 ), orientation: { heading: 0.11355958593902571, @@ -375,8 +377,9 @@ roll: 0.00039019018274721873, }, }); - viewer.clockViewModel.currentTime = - Cesium.JulianDate.fromIso8601("2017-09-22T18:00:00Z"); + viewer.clockViewModel.currentTime = Cesium.JulianDate.fromIso8601( + "2017-09-22T18:00:00Z" + ); }, }, { @@ -386,7 +389,7 @@ destination: new Cesium.Cartesian3( 282157.6960889096, 5638892.465594703, - 2978736.186473513, + 2978736.186473513 ), orientation: { heading: 4.747266966349747, @@ -394,12 +397,13 @@ roll: 6.280340554587955, }, }); - viewer.clockViewModel.currentTime = - Cesium.JulianDate.fromIso8601("2017-09-22T04:00:00Z"); + viewer.clockViewModel.currentTime = Cesium.JulianDate.fromIso8601( + "2017-09-22T04:00:00Z" + ); }, }, ], - "zoomButtons", + "zoomButtons" ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Globe Translucency.html b/Apps/Sandcastle/gallery/Globe Translucency.html index cf066f021bf7..2fc38c4f7481 100644 --- a/Apps/Sandcastle/gallery/Globe Translucency.html +++ b/Apps/Sandcastle/gallery/Globe Translucency.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -93,7 +93,7 @@ 400.0, 0.0, 800.0, - 1.0, + 1.0 ); const longitude = -3.82518; @@ -114,19 +114,43 @@ polygon: { hierarchy: new Cesium.PolygonHierarchy( Cesium.Cartesian3.fromDegreesArrayHeights([ - -3.8152789692233817, 53.124521420389996, 200.20779492422255, - -3.8165955002619016, 53.12555934545405, 205.85834336951655, - -3.8201599842222054, 53.12388420656903, 230.82362697069453, - -3.8198667503545027, 53.123748567587455, 225.53297006293968, - -3.8190548496317476, 53.1240486000822, 221.82677773619432, - -3.817536387097508, 53.122763476393764, 209.94136782255705, - -3.8169125359199336, 53.12285547981627, 210.96626238861327, - -3.8166873871853073, 53.12299403424474, 211.02223937734595, - -3.8163695374580873, 53.12300505277307, 211.25942926271824, - -3.8162743040622313, 53.12281471203994, 212.35109129094147, - -3.8159746138174193, 53.12280996651767, 214.87977416348798, - -3.815429896849304, 53.1236135347983, 209.72496223706005, - ]), + -3.8152789692233817, + 53.124521420389996, + 200.20779492422255, + -3.8165955002619016, + 53.12555934545405, + 205.85834336951655, + -3.8201599842222054, + 53.12388420656903, + 230.82362697069453, + -3.8198667503545027, + 53.123748567587455, + 225.53297006293968, + -3.8190548496317476, + 53.1240486000822, + 221.82677773619432, + -3.817536387097508, + 53.122763476393764, + 209.94136782255705, + -3.8169125359199336, + 53.12285547981627, + 210.96626238861327, + -3.8166873871853073, + 53.12299403424474, + 211.02223937734595, + -3.8163695374580873, + 53.12300505277307, + 211.25942926271824, + -3.8162743040622313, + 53.12281471203994, + 212.35109129094147, + -3.8159746138174193, + 53.12280996651767, + 214.87977416348798, + -3.815429896849304, + 53.1236135347983, + 209.72496223706005, + ]) ), material: Cesium.Color.LIME.withAlpha(0.5), classificationType: Cesium.ClassificationType.TERRAIN, @@ -136,27 +160,69 @@ const polyline = viewer.entities.add({ polyline: { positions: Cesium.Cartesian3.fromDegreesArrayHeights([ - -3.8098444201746373, 53.1190304262546, 286.1875170545701, - -3.8099801237370663, 53.119539531697576, 288.7733884242394, - -3.810165716635671, 53.11979180761567, 290.9294630315179, - -3.8104840812145357, 53.12007534956926, 292.6392327626228, - -3.8105689502073554, 53.120259094792196, 292.222036965774, - -3.811027311824268, 53.120409248874196, 289.61356291617307, - -3.811530473295422, 53.12063281057782, 284.01098712543586, - -3.8120545342562693, 53.120742539082435, 280.118191867836, - -3.812444493044727, 53.120813289759326, 276.0400221387852, - -3.812779626711285, 53.12094275348024, 271.1187399484896, - -3.8133560322579494, 53.12104757866638, 263.3495497598578, - -3.8137266493960085, 53.12120789867194, 257.73878624321316, - -3.8142552291751133, 53.121321248522904, 251.87265828778177, - -3.814322603988525, 53.12174170121103, 238.7082749547689, - -3.8143764268391314, 53.1219492923309, 235.0371831845662, - -3.8148156514145786, 53.12210819668669, 230.2458816627467, - -3.8155394721966163, 53.1222990144029, 221.33319292262706, - -3.8159828072920927, 53.12203093429715, 223.66664756982703, - -3.816678108944717, 53.12183939425214, 223.8787312412801, - -3.817466081093726, 53.121751900508535, 224.52293229989735, - -3.8183082996527955, 53.12173266141031, 223.3672181535749, + -3.8098444201746373, + 53.1190304262546, + 286.1875170545701, + -3.8099801237370663, + 53.119539531697576, + 288.7733884242394, + -3.810165716635671, + 53.11979180761567, + 290.9294630315179, + -3.8104840812145357, + 53.12007534956926, + 292.6392327626228, + -3.8105689502073554, + 53.120259094792196, + 292.222036965774, + -3.811027311824268, + 53.120409248874196, + 289.61356291617307, + -3.811530473295422, + 53.12063281057782, + 284.01098712543586, + -3.8120545342562693, + 53.120742539082435, + 280.118191867836, + -3.812444493044727, + 53.120813289759326, + 276.0400221387852, + -3.812779626711285, + 53.12094275348024, + 271.1187399484896, + -3.8133560322579494, + 53.12104757866638, + 263.3495497598578, + -3.8137266493960085, + 53.12120789867194, + 257.73878624321316, + -3.8142552291751133, + 53.121321248522904, + 251.87265828778177, + -3.814322603988525, + 53.12174170121103, + 238.7082749547689, + -3.8143764268391314, + 53.1219492923309, + 235.0371831845662, + -3.8148156514145786, + 53.12210819668669, + 230.2458816627467, + -3.8155394721966163, + 53.1222990144029, + 221.33319292262706, + -3.8159828072920927, + 53.12203093429715, + 223.66664756982703, + -3.816678108944717, + 53.12183939425214, + 223.8787312412801, + -3.817466081093726, + 53.121751900508535, + 224.52293229989735, + -3.8183082996527955, + 53.12173266141031, + 223.3672181535749, ]), width: 8, material: new Cesium.PolylineOutlineMaterialProperty({ @@ -205,12 +271,12 @@ destination: new Cesium.Cartesian3( 3826465.9884728403, -254831.02751468265, - 5081387.671561018, + 5081387.671561018 ), orientation: new Cesium.HeadingPitchRoll( 3.3889450556243754, -0.5276382514771969, - 6.282272566663295, + 6.282272566663295 ), endTransform: Cesium.Matrix4.IDENTITY, }); @@ -219,12 +285,12 @@ destination: new Cesium.Cartesian3( 3827270.552916987, -255123.18143177085, - 5079147.091351856, + 5079147.091351856 ), orientation: new Cesium.HeadingPitchRoll( 3.2624281242239963, -0.22213535190506972, - 6.282786783842843, + 6.282786783842843 ), duration: 0.0, }); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Google Earth Enterprise.html b/Apps/Sandcastle/gallery/Google Earth Enterprise.html index 651d2114543f..d52a5c896819 100644 --- a/Apps/Sandcastle/gallery/Google Earth Enterprise.html +++ b/Apps/Sandcastle/gallery/Google Earth Enterprise.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,17 +38,18 @@ 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) { 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 6437a2fb7c19..aafbf1c34dbc 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -67,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, @@ -89,7 +89,7 @@ const cameraOffset = new Cesium.HeadingPitchRange( Cesium.Math.toRadians(95.0), Cesium.Math.toRadians(-18.0), - 600.0, + 600.0 ); viewer.zoomTo(buildingTileset, cameraOffset); diff --git a/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html b/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html index d4d68c1c97d6..7635f7233165 100644 --- a/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -54,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 d35dcb4b3ef4..4f9d23c8b25d 100644 --- a/Apps/Sandcastle/gallery/HTML Overlays.html +++ b/Apps/Sandcastle/gallery/HTML Overlays.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,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 26c92dc047c0..adc2ec24dcde 100644 --- a/Apps/Sandcastle/gallery/HeadingPitchRoll.html +++ b/Apps/Sandcastle/gallery/HeadingPitchRoll.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -113,7 +113,7 @@ <h1>Loading...</h1> let speedVector = new Cesium.Cartesian3(); const fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator( "north", - "west", + "west" ); const headingSpan = document.getElementById("heading"); @@ -130,10 +130,10 @@ <h1>Loading...</h1> position, hpRoll, Cesium.Ellipsoid.WGS84, - fixedFrameTransform, + fixedFrameTransform ), minimumPixelSize: 128, - }), + }) ); planePrimitive.readyEvent.addEventListener(() => { @@ -219,12 +219,12 @@ <h1>Loading...</h1> 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( @@ -232,7 +232,7 @@ <h1>Loading...</h1> hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform, - planePrimitive.modelMatrix, + planePrimitive.modelMatrix ); if (fromBehind.checked) { diff --git a/Apps/Sandcastle/gallery/Hello World.html b/Apps/Sandcastle/gallery/Hello World.html index e0243a45af91..23d9f6b702cb 100644 --- a/Apps/Sandcastle/gallery/Hello World.html +++ b/Apps/Sandcastle/gallery/Hello World.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/High Dynamic Range.html b/Apps/Sandcastle/gallery/High Dynamic Range.html index 00aefefcac0e..e3238deabb3a 100644 --- a/Apps/Sandcastle/gallery/High Dynamic Range.html +++ b/Apps/Sandcastle/gallery/High Dynamic Range.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -77,7 +77,7 @@ function (checked) { viewer.scene.highDynamicRange = checked; }, - "hdr-toggle", + "hdr-toggle" ); const toneMapOptions = [ @@ -134,7 +134,7 @@ const position = Cesium.Cartesian3.fromRadians( -1.9516424279517286, 0.6322397098422969, - 1239.0006814631095, + 1239.0006814631095 ); const heading = Cesium.Math.toRadians(-15.0); const pitch = 0; @@ -158,12 +158,12 @@ destination: new Cesium.Cartesian3( -1915097.7863741855, -4783356.851539908, - 3748887.43462683, + 3748887.43462683 ), orientation: new Cesium.HeadingPitchRoll( 6.166004548388564, -0.043242401760068994, - 0.002179961955988574, + 0.002179961955988574 ), endTransform: Cesium.Matrix4.IDENTITY, }); @@ -178,12 +178,12 @@ destination: new Cesium.Cartesian3( -1915097.7863741855, -4783356.851539908, - 3748887.43462683, + 3748887.43462683 ), orientation: new Cesium.HeadingPitchRoll( 6.166004548388564, -0.043242401760068994, - 0.002179961955988574, + 0.002179961955988574 ), endTransform: Cesium.Matrix4.IDENTITY, }); diff --git a/Apps/Sandcastle/gallery/I3S 3D Object Layer.html b/Apps/Sandcastle/gallery/I3S 3D Object Layer.html index 2046fe9d401d..d54509ef4471 100644 --- a/Apps/Sandcastle/gallery/I3S 3D Object Layer.html +++ b/Apps/Sandcastle/gallery/I3S 3D Object Layer.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,7 +51,7 @@ <h1>Loading...</h1> // 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 = { @@ -61,7 +61,7 @@ <h1>Loading...</h1> // 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 diff --git a/Apps/Sandcastle/gallery/I3S Building Scene Layer.html b/Apps/Sandcastle/gallery/I3S Building Scene Layer.html index e777e08e4b7d..e18efa075804 100644 --- a/Apps/Sandcastle/gallery/I3S Building Scene Layer.html +++ b/Apps/Sandcastle/gallery/I3S Building Scene Layer.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -44,8 +44,8 @@ <h1>Loading...</h1> const viewer = new Cesium.Viewer("cesiumContainer", { terrain: 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" + ) ), animation: false, timeline: false, @@ -71,7 +71,7 @@ <h1>Loading...</h1> // Create I3S data provider const i3sProvider = await Cesium.I3SDataProvider.fromUrl( tours["Turanga Library"], - i3sOptions, + i3sOptions ); Cesium.I3SBuildingSceneLayerExplorer("toolbar", i3sProvider); diff --git a/Apps/Sandcastle/gallery/I3S Feature Picking.html b/Apps/Sandcastle/gallery/I3S Feature Picking.html index 4ae7366352b3..38747cf2f7d1 100644 --- a/Apps/Sandcastle/gallery/I3S Feature Picking.html +++ b/Apps/Sandcastle/gallery/I3S Feature Picking.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,7 +51,7 @@ <h1>Loading...</h1> // 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 = { @@ -61,7 +61,7 @@ <h1>Loading...</h1> // 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 diff --git a/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html b/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html index d2f32238087e..f41b28c5b99a 100644 --- a/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html +++ b/Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -52,7 +52,7 @@ <h1>Loading...</h1> // 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 @@ -63,7 +63,7 @@ <h1>Loading...</h1> // Create I3S data provider const i3sProvider = await Cesium.I3SDataProvider.fromUrl( tours.Frankfurt, - i3sOptions, + i3sOptions ); // Add the i3s layer provider as a primitive data type diff --git a/Apps/Sandcastle/gallery/Image-Based Lighting.html b/Apps/Sandcastle/gallery/Image-Based Lighting.html index da68bd9c130b..648ff9bdbd21 100644 --- a/Apps/Sandcastle/gallery/Image-Based Lighting.html +++ b/Apps/Sandcastle/gallery/Image-Based Lighting.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -69,47 +69,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]; @@ -124,7 +124,7 @@ url: modelURL, modelMatrix: modelMatrix, minimumPixelSize: 128, - }), + }) ); model.readyEvent.addEventListener(() => { @@ -177,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 259c4ceff464..c8bbf44de0ea 100644 --- a/Apps/Sandcastle/gallery/Imagery Adjustment.html +++ b/Apps/Sandcastle/gallery/Imagery Adjustment.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Imagery Color To Alpha.html b/Apps/Sandcastle/gallery/Imagery Color To Alpha.html index 8fa3ed032883..02f8659e3af5 100644 --- a/Apps/Sandcastle/gallery/Imagery Color To Alpha.html +++ b/Apps/Sandcastle/gallery/Imagery Color To Alpha.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -64,7 +64,7 @@ const singleTileLayer = Cesium.ImageryLayer.fromProviderAsync( Cesium.SingleTileImageryProvider.fromUrl("../images/earthbump1k.jpg", { rectangle: Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0), - }), + }) ); layers.add(singleTileLayer); diff --git a/Apps/Sandcastle/gallery/Imagery Cutout.html b/Apps/Sandcastle/gallery/Imagery Cutout.html index 5dbdcd61068e..110a8f466a87 100644 --- a/Apps/Sandcastle/gallery/Imagery Cutout.html +++ b/Apps/Sandcastle/gallery/Imagery Cutout.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -49,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, }); @@ -75,13 +75,13 @@ const logo = Cesium.ImageryLayer.fromProviderAsync( 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), + Cesium.IonImageryProvider.fromAssetId(3812) ); earthAtNight.cutoutRectangle = Cesium.Rectangle.fromDegrees(-100, 10, -60, 50); earthAtNight.alpha = 0.9; @@ -118,7 +118,7 @@ flags[flagName] = true; } }, - false, + false ); document.addEventListener( @@ -129,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 4e309a339dd7..ec5b91aa05f1 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Manipulation.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Manipulation.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -158,13 +158,13 @@ "Bing Maps Road", Cesium.createWorldImageryAsync({ style: Cesium.IonWorldImageryStyle.ROAD, - }), + }) ); addBaseLayerOption( "ArcGIS World Street Maps", Cesium.ArcGisMapServerImageryProvider.fromUrl( - "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", - ), + "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" + ) ); addBaseLayerOption("OpenStreetMaps", new Cesium.OpenStreetMapImageryProvider()); addBaseLayerOption( @@ -174,25 +174,26 @@ fileExtension: "jpg", credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.", - }), + }) ); addBaseLayerOption( "Natural Earth II (local)", Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), - ), + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") + ) ); addBaseLayerOption( "USGS Shaded Relief (via WMTS)", new Cesium.WebMapTileServiceImageryProvider({ - url: "https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS", + url: + "https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS", layer: "USGSShadedReliefOnly", style: "default", format: "image/jpeg", tileMatrixSetID: "default028mm", maximumLevel: 19, credit: "U. S. Geological Survey", - }), + }) ); // Create the additional layers @@ -206,7 +207,7 @@ transparent: "true", format: "image/png", }, - }), + }) ); addAdditionalLayerOption( "United States Weather Radar", @@ -218,14 +219,14 @@ transparent: "true", format: "image/png", }, - }), + }) ); addAdditionalLayerOption( "TileMapService Image", Cesium.TileMapServiceImageryProvider.fromUrl( - "../images/cesium_maptiler/Cesium_Logo_Color", + "../images/cesium_maptiler/Cesium_Logo_Color" ), - 0.2, + 0.2 ); addAdditionalLayerOption( "Single Image", @@ -233,16 +234,16 @@ "../images/Cesium_Logo_overlay.png", { rectangle: Cesium.Rectangle.fromDegrees(-115.0, 38.0, -107, 39.75), - }, + } ), - 1.0, + 1.0 ); addAdditionalLayerOption("Grid", new Cesium.GridImageryProvider(), 1.0, false); addAdditionalLayerOption( "Tile Coordinates", new Cesium.TileCoordinatesImageryProvider(), 1.0, - false, + false ); } @@ -263,7 +264,7 @@ name, imageryProviderPromise, alpha, - show, + show ) { try { const imageryProvider = await Promise.resolve(imageryProviderPromise); diff --git a/Apps/Sandcastle/gallery/Imagery Layers Split.html b/Apps/Sandcastle/gallery/Imagery Layers Split.html index 37927116fc29..008c46dfb122 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Split.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Split.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -53,8 +53,8 @@ const viewer = new Cesium.Viewer("cesiumContainer", { baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.ArcGisMapServerImageryProvider.fromUrl( - "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", - ), + "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" + ) ), baseLayerPicker: false, infoBox: false, @@ -62,7 +62,7 @@ const layers = viewer.imageryLayers; const earthAtNight = Cesium.ImageryLayer.fromProviderAsync( - Cesium.IonImageryProvider.fromAssetId(3812), + Cesium.IonImageryProvider.fromAssetId(3812) ); earthAtNight.splitDirection = Cesium.SplitDirection.LEFT; // Only show to the left of the slider. layers.add(earthAtNight); diff --git a/Apps/Sandcastle/gallery/Imagery Layers Texture Filters.html b/Apps/Sandcastle/gallery/Imagery Layers Texture Filters.html index 5fb6cf125dd8..400daec3de17 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Texture Filters.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Texture Filters.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -60,15 +60,15 @@ const layerLinear = Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), - ), + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") + ) ); layers.add(layerLinear); const layerNearest = Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl( - Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), - ), + Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII") + ) ); layers.add(layerNearest); diff --git a/Apps/Sandcastle/gallery/Imagery Layers.html b/Apps/Sandcastle/gallery/Imagery Layers.html index 34ee6db78f38..f62e884b4b5a 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers.html +++ b/Apps/Sandcastle/gallery/Imagery Layers.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,7 +38,7 @@ 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; @@ -47,7 +47,7 @@ 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), - }), + }) ); layers.add(cesiumLogo); //Sandcastle_End diff --git a/Apps/Sandcastle/gallery/Interpolation.html b/Apps/Sandcastle/gallery/Interpolation.html index d0559b27d7a8..4f42ca9a5f22 100644 --- a/Apps/Sandcastle/gallery/Interpolation.html +++ b/Apps/Sandcastle/gallery/Interpolation.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -73,7 +73,7 @@ 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); @@ -132,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)) ); }); @@ -144,8 +144,8 @@ new Cesium.HeadingPitchRange( Cesium.Math.toRadians(-90), Cesium.Math.toRadians(-15), - 7500, - ), + 7500 + ) ); }); @@ -185,7 +185,7 @@ }, }, ], - "interpolationMenu", + "interpolationMenu" ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/Japan Buildings.html b/Apps/Sandcastle/gallery/Japan Buildings.html index 1d9ad46e45b6..d333a3ddb618 100644 --- a/Apps/Sandcastle/gallery/Japan Buildings.html +++ b/Apps/Sandcastle/gallery/Japan Buildings.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -57,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 ), }, }; @@ -77,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 ), }, }; @@ -97,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 ), }, }; @@ -117,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 ), }, }; @@ -137,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 ), }, }; @@ -157,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 ), }, }; @@ -177,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 ), }, }; @@ -251,7 +251,7 @@ scene.preRender.addEventListener(function (scene, time) { scene.light.direction = Cesium.Cartesian3.clone( scene.camera.directionWC, - scene.light.direction, + scene.light.direction ); }); diff --git a/Apps/Sandcastle/gallery/KML Tours.html b/Apps/Sandcastle/gallery/KML Tours.html index e418008b4135..1211be6e1a3d 100644 --- a/Apps/Sandcastle/gallery/KML Tours.html +++ b/Apps/Sandcastle/gallery/KML Tours.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,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 2e580090a54f..43ed813da497 100644 --- a/Apps/Sandcastle/gallery/KML.html +++ b/Apps/Sandcastle/gallery/KML.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,8 +46,8 @@ viewer.dataSources.add( Cesium.KmlDataSource.load( "../../SampleData/kml/facilities/facilities.kml", - options, - ), + options + ) ); }, }, @@ -58,8 +58,8 @@ viewer.dataSources.add( Cesium.KmlDataSource.load( "../../SampleData/kml/gdpPerCapita2008.kmz", - options, - ), + options + ) ); }, }, @@ -70,8 +70,8 @@ .add( Cesium.KmlDataSource.load( "../../SampleData/kml/bikeRide.kml", - options, - ), + options + ) ) .then(function (dataSource) { viewer.clock.shouldAnimate = false; @@ -86,7 +86,7 @@ }, }, ], - "toolbar", + "toolbar" ); Sandcastle.reset = function () { diff --git a/Apps/Sandcastle/gallery/Labels.html b/Apps/Sandcastle/gallery/Labels.html index c8844879a737..015b493af0af 100644 --- a/Apps/Sandcastle/gallery/Labels.html +++ b/Apps/Sandcastle/gallery/Labels.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -91,7 +91,7 @@ 1.5e2, 3.0, 1.5e7, - 0.5, + 0.5 ), }, }); @@ -158,20 +158,21 @@ const minFontSize = 1.0; const maxFontSize = 48.0; - labelListenerCallback = viewer.scene.preUpdate.addEventListener( - function (scene, time) { - entity.label.outlineWidth += outlineDelta; - if (entity.label.outlineWidth >= 4.0 || entity.label.outlineWidth <= 0.0) { - outlineDelta *= -1.0; - } + labelListenerCallback = viewer.scene.preUpdate.addEventListener(function ( + scene, + time + ) { + entity.label.outlineWidth += outlineDelta; + if (entity.label.outlineWidth >= 4.0 || entity.label.outlineWidth <= 0.0) { + outlineDelta *= -1.0; + } - fontSize += fontDelta; - if (fontSize >= maxFontSize || fontSize <= minFontSize) { - fontDelta *= -1.0; - } - entity.label.font = `${fontSize}px Calibri`; - }, - ); + fontSize += fontDelta; + if (fontSize >= maxFontSize || fontSize <= minFontSize) { + fontDelta *= -1.0; + } + entity.label.font = `${fontSize}px Calibri`; + }); } Sandcastle.addToolbarMenu([ diff --git a/Apps/Sandcastle/gallery/LensFlare.html b/Apps/Sandcastle/gallery/LensFlare.html index 106730c744bc..04ad27bcb9cc 100644 --- a/Apps/Sandcastle/gallery/LensFlare.html +++ b/Apps/Sandcastle/gallery/LensFlare.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -119,7 +119,7 @@ } const lensFlare = viewer.scene.postProcessStages.add( - Cesium.PostProcessStageLibrary.createLensFlareStage(), + Cesium.PostProcessStageLibrary.createLensFlareStage() ); function updatePostProcess() { @@ -137,22 +137,22 @@ 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); diff --git a/Apps/Sandcastle/gallery/Lighting.html b/Apps/Sandcastle/gallery/Lighting.html index 8bdd8b1380e4..66a5c56920bb 100644 --- a/Apps/Sandcastle/gallery/Lighting.html +++ b/Apps/Sandcastle/gallery/Lighting.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,15 +51,14 @@ ) { Cesium.Transforms.computeTemeToPseudoFixedMatrix(date, icrfToFixed); } - const moonPosition = - Cesium.Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame( - date, - scratchMoonPosition, - ); + 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); } @@ -68,7 +67,7 @@ direction: new Cesium.Cartesian3( 0.2454278300540191, 0.8842635425193919, - 0.39729481195458805, + 0.39729481195458805 ), }); @@ -88,7 +87,7 @@ direction: new Cesium.Cartesian3( -0.2454278300540191, 0.8842635425193919, - 0.39729481195458805, + 0.39729481195458805 ), color: Cesium.Color.fromCssColorString("#deca7c"), }); @@ -97,7 +96,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); @@ -108,7 +107,7 @@ position: Cesium.Cartesian3.fromRadians( -2.1463338399937277, 0.6677959688982861, - 32.18991401746337, + 32.18991401746337 ), model: { uri: "../../SampleData/models/CesiumBalloon/CesiumBalloon.glb", @@ -120,7 +119,7 @@ position: Cesium.Cartesian3.fromRadians( -2.14633449752228, 0.667796065242357, - 24.47647034111423, + 24.47647034111423 ), cylinder: { length: 8.0, @@ -134,7 +133,7 @@ position: Cesium.Cartesian3.fromRadians( -2.1463332294173365, 0.6677959755384729, - 26.2876064083145, + 26.2876064083145 ), ellipsoid: { radii: new Cesium.Cartesian3(2.5, 2.5, 2.5), @@ -147,7 +146,7 @@ const endTime = Cesium.JulianDate.addDays( currentTime, 2, - new Cesium.JulianDate(), + new Cesium.JulianDate() ); viewer.clock.currentTime = currentTime; @@ -166,12 +165,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 e7724dd432fb..47e1865b9619 100644 --- a/Apps/Sandcastle/gallery/LocalToFixedFrame.html +++ b/Apps/Sandcastle/gallery/LocalToFixedFrame.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -120,10 +120,10 @@ <h1>Loading...</h1> position, hpRoll, Cesium.Ellipsoid.WGS84, - converter, + converter ), minimumPixelSize: 128, - }), + }) ); primitives.push({ @@ -138,14 +138,14 @@ <h1>Loading...</h1> 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(); @@ -242,7 +242,7 @@ <h1>Loading...</h1> hpRoll, Cesium.Ellipsoid.WGS84, converter, - primitive.modelMatrix, + primitive.modelMatrix ); } }); diff --git a/Apps/Sandcastle/gallery/MSAA.html b/Apps/Sandcastle/gallery/MSAA.html index 5fbf79be4078..38dfdd3937a7 100644 --- a/Apps/Sandcastle/gallery/MSAA.html +++ b/Apps/Sandcastle/gallery/MSAA.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -45,7 +45,7 @@ const position = Cesium.Cartesian3.fromDegrees( -123.0744619, 44.0503706, - height, + height ); const heading = Cesium.Math.toRadians(135); const pitch = 0; @@ -66,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); @@ -100,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, }); @@ -121,7 +121,7 @@ destination: new Cesium.Cartesian3( 1234138.7804841248, -5086063.633843134, - 3633284.606361642, + 3633284.606361642 ), orientation: { heading: 0.4304630387656614, @@ -140,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 12084ff831f7..fabcd7d8d31b 100644 --- a/Apps/Sandcastle/gallery/Manually Controlled Animation.html +++ b/Apps/Sandcastle/gallery/Manually Controlled Animation.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -39,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(); @@ -53,12 +53,12 @@ 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); @@ -72,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. @@ -81,12 +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; } @@ -105,7 +105,7 @@ await Cesium.Model.fromGltfAsync({ url: "../../SampleData/models/CesiumMan/Cesium_Man.glb", scale: 4, - }), + }) ); modelPrimitive.readyEvent.addEventListener(() => { @@ -128,12 +128,12 @@ pos, vel, viewer.scene.globe.ellipsoid, - rotation, + rotation ); Cesium.Matrix4.fromRotationTranslation( rotation, pos, - modelPrimitive.modelMatrix, + modelPrimitive.modelMatrix ); }); } catch (error) { diff --git a/Apps/Sandcastle/gallery/Map Pins.html b/Apps/Sandcastle/gallery/Map Pins.html index 0412b4f78fe7..4cee6dc5592b 100644 --- a/Apps/Sandcastle/gallery/Map Pins.html +++ b/Apps/Sandcastle/gallery/Map Pins.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -56,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", @@ -70,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", @@ -83,11 +83,11 @@ }); //Since some of the pins are created asynchronously, wait for them all to load before zooming/ - Promise.all([bluePin, questionPin, groceryPin, hospitalPin]).then( - function (pins) { - viewer.zoomTo(pins); - }, - ); + 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 803d899b99a8..866334d34df7 100644 --- a/Apps/Sandcastle/gallery/Materials.html +++ b/Apps/Sandcastle/gallery/Materials.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -361,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(); @@ -374,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(); @@ -557,7 +557,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ aboveGround: false, }), - }), + }) ); worldRectangle = scene.primitives.add( @@ -572,14 +572,21 @@ aboveGround: false, }), show: false, - }), + }) ); 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 2dcef33cfd28..ecf226cee792 100644 --- a/Apps/Sandcastle/gallery/Montreal Point Cloud.html +++ b/Apps/Sandcastle/gallery/Montreal Point Cloud.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -92,18 +92,18 @@ destination: new Cesium.Cartesian3( 1223285.2286828577, -4319476.080312792, - 4562579.020145769, + 4562579.020145769 ), orientation: { direction: new Cesium.Cartesian3( 0.63053223097472, 0.47519958296727743, - -0.6136892226931869, + -0.6136892226931869 ), up: new Cesium.Cartesian3( 0.7699959023135587, -0.4824455703743441, - 0.41755548379407276, + 0.41755548379407276 ), }, duration: 0, @@ -118,18 +118,18 @@ destination: new Cesium.Cartesian3( 1268112.9336926902, -4347432.089579957, - 4539129.813606778, + 4539129.813606778 ), orientation: { direction: new Cesium.Cartesian3( -0.23288147105081208, 0.9376599248561527, - -0.25799241415197466, + -0.25799241415197466 ), up: new Cesium.Cartesian3( -0.015748156073159988, 0.2616156268422992, - 0.9650436567182887, + 0.9650436567182887 ), }, easingFunction: Cesium.EasingFunction.QUADRATIC_IN_OUT, @@ -143,18 +143,18 @@ destination: new Cesium.Cartesian3( 1266560.143870489, -4278126.842199712, - 4542690.264566619, + 4542690.264566619 ), orientation: { direction: new Cesium.Cartesian3( -0.3402460635871598, -0.46669052711538217, - -0.8163532128400116, + -0.8163532128400116 ), up: new Cesium.Cartesian3( 0.08964012922691329, -0.8802940231336787, - 0.46588311846138497, + 0.46588311846138497 ), }, easingFunction: Cesium.EasingFunction.QUADRATIC_IN_OUT, @@ -168,18 +168,18 @@ destination: new Cesium.Cartesian3( 1267081.619536883, -4290744.917138439, - 4530941.041519919, + 4530941.041519919 ), orientation: { direction: new Cesium.Cartesian3( -0.735813047510908, 0.6294547560338262, - 0.24973159435503312, + 0.24973159435503312 ), up: new Cesium.Cartesian3( -0.09796934684423217, -0.4638476756625683, - 0.88048131204549, + 0.88048131204549 ), }, easingFunction: Cesium.EasingFunction.QUADRATIC_IN_OUT, @@ -193,18 +193,18 @@ destination: new Cesium.Cartesian3( 1269319.8408991008, -4293301.826913256, - 4527724.561372451, + 4527724.561372451 ), orientation: { direction: new Cesium.Cartesian3( -0.742505030107832, -0.3413204607149223, - -0.5763563336703441, + -0.5763563336703441 ), up: new Cesium.Cartesian3( -0.04655102331027917, -0.8320643756800384, - 0.5527222421370013, + 0.5527222421370013 ), }, easingFunction: Cesium.EasingFunction.QUADRATIC_IN_OUT, @@ -218,18 +218,18 @@ destination: new Cesium.Cartesian3( 1263148.6745904868, -4297262.506644816, - 4525958.844284831, + 4525958.844284831 ), orientation: { direction: new Cesium.Cartesian3( 0.6550952540993403, 0.7551122393690295, - 0.025606913355780074, + 0.025606913355780074 ), up: new Cesium.Cartesian3( 0.46670450470847263, -0.4310758971098583, - 0.7722437932516845, + 0.7722437932516845 ), }, easingFunction: Cesium.EasingFunction.QUADRATIC_IN_OUT, diff --git a/Apps/Sandcastle/gallery/Moon.html b/Apps/Sandcastle/gallery/Moon.html index 543f20e6129d..63f88147c22c 100644 --- a/Apps/Sandcastle/gallery/Moon.html +++ b/Apps/Sandcastle/gallery/Moon.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -153,18 +153,18 @@ destination: new Cesium.Cartesian3( 2134594.9298812235, 1256488.0678322134, - 379606.9284823841, + 379606.9284823841 ), orientation: { direction: new Cesium.Cartesian3( -0.8518395698371783, -0.5014189063342804, - -0.1514873843927112, + -0.1514873843927112 ), up: new Cesium.Cartesian3( -0.13054959630640847, -0.07684549781463353, - 0.9884591910493093, + 0.9884591910493093 ), }, easingFunction: Cesium.EasingFunction.LINEAR_NONE, @@ -174,18 +174,18 @@ destination: new Cesium.Cartesian3( 1609100.311044896, 733266.0643925276, - 53608.976740262646, + 53608.976740262646 ), orientation: { direction: new Cesium.Cartesian3( -0.41704286323660256, -0.7222280712427744, - -0.5517806297183315, + -0.5517806297183315 ), up: new Cesium.Cartesian3( 0.8621189850799429, -0.12210806245903304, - -0.49177278965720556, + -0.49177278965720556 ), }, easingFunction: Cesium.EasingFunction.LINEAR_NONE, @@ -195,18 +195,18 @@ destination: new Cesium.Cartesian3( 1613572.8201475781, -677039.3827805589, - 339559.7958496013, + 339559.7958496013 ), orientation: { direction: new Cesium.Cartesian3( -0.10007925201262617, 0.8771366500325052, - -0.4696971795597116, + -0.4696971795597116 ), up: new Cesium.Cartesian3( 0.9948921707513932, 0.08196514973381885, - -0.058917593354560566, + -0.058917593354560566 ), }, easingFunction: Cesium.EasingFunction.LINEAR_NONE, @@ -216,18 +216,18 @@ destination: new Cesium.Cartesian3( 1368413.3560818078, -166198.00035620513, - -1203576.7397013502, + -1203576.7397013502 ), orientation: { direction: new Cesium.Cartesian3( -0.8601315724135887, -0.5073902275496569, - 0.05223825345888711, + 0.05223825345888711 ), up: new Cesium.Cartesian3( 0.2639103814694499, -0.5303301783281616, - -0.8056681776681204, + -0.8056681776681204 ), }, easingFunction: Cesium.EasingFunction.LINEAR_NONE, @@ -239,21 +239,21 @@ new Cesium.Cartesian3( -17505.087036391753, 38147.40236305639, - -1769721.5748224584, + -1769721.5748224584 ), - 40000.0, - ), + 40000.0 + ) ), orientation: { direction: new Cesium.Cartesian3( 0.2568703591904826, -0.6405212914728244, - 0.7237058060699372, + 0.7237058060699372 ), up: new Cesium.Cartesian3( 0.26770932874967773, -0.6723714327527822, - -0.6901075073627064, + -0.6901075073627064 ), }, easingFunction: Cesium.EasingFunction.LINEAR_NONE, @@ -261,11 +261,12 @@ const camera = viewer.scene.camera; const rotationSpeed = Cesium.Math.toRadians(0.1); - const removeRotation = viewer.scene.postRender.addEventListener( - function (scene, time) { - viewer.scene.camera.rotateRight(rotationSpeed); - }, - ); + const removeRotation = viewer.scene.postRender.addEventListener(function ( + scene, + time + ) { + viewer.scene.camera.rotateRight(rotationSpeed); + }); const options1 = [ { @@ -323,15 +324,15 @@ const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas); handler.setInputAction( () => removeRotation(), - Cesium.ScreenSpaceEventType.LEFT_DOWN, + Cesium.ScreenSpaceEventType.LEFT_DOWN ); handler.setInputAction( () => removeRotation(), - Cesium.ScreenSpaceEventType.RIGHT_DOWN, + Cesium.ScreenSpaceEventType.RIGHT_DOWN ); handler.setInputAction( () => removeRotation(), - Cesium.ScreenSpaceEventType.MIDDLE_DOWN, + Cesium.ScreenSpaceEventType.MIDDLE_DOWN ); handler.setInputAction(() => removeRotation(), Cesium.ScreenSpaceEventType.WHEEL); diff --git a/Apps/Sandcastle/gallery/Multi-part CZML.html b/Apps/Sandcastle/gallery/Multi-part CZML.html index 009aab604ea9..d735ea3db36a 100644 --- a/Apps/Sandcastle/gallery/Multi-part CZML.html +++ b/Apps/Sandcastle/gallery/Multi-part CZML.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -93,8 +93,9 @@ // Follow the vehicle with the camera. if (!viewer.trackedEntity) { - viewer.trackedEntity = vehicleEntity = - dataSource.entities.getById("Vehicle"); + viewer.trackedEntity = vehicleEntity = dataSource.entities.getById( + "Vehicle" + ); } }); } @@ -110,7 +111,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. @@ -129,7 +130,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 e17c597cf970..b04d02354327 100644 --- a/Apps/Sandcastle/gallery/Multiple Synced Views.html +++ b/Apps/Sandcastle/gallery/Multiple Synced Views.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -76,7 +76,7 @@ // The center of the view is the point that the 3D camera is focusing on const viewCenter = new Cesium.Cartesian2( Math.floor(view3D.canvas.clientWidth / 2), - Math.floor(view3D.canvas.clientHeight / 2), + Math.floor(view3D.canvas.clientHeight / 2) ); // Given the pixel in the center, get the world position const newWorldPosition = view3D.scene.camera.pickEllipsoid(viewCenter); @@ -88,13 +88,13 @@ // Get the distance between the world position of the point the camera is focusing on, and the camera's world position distance = Cesium.Cartesian3.distance( worldPosition, - view3D.scene.camera.positionWC, + view3D.scene.camera.positionWC ); // Tell the 2D camera to look at the point of focus. The distance controls how zoomed in the 2D view is // (try replacing `distance` in the line below with `1e7`. The view will still sync, but will have a constant zoom) view2D.scene.camera.lookAt( worldPosition, - new Cesium.Cartesian3(0.0, 0.0, distance), + new Cesium.Cartesian3(0.0, 0.0, distance) ); } diff --git a/Apps/Sandcastle/gallery/Natural Earth II.html b/Apps/Sandcastle/gallery/Natural Earth II.html index 1a3bc27e9bb1..e0292e3ec934 100644 --- a/Apps/Sandcastle/gallery/Natural Earth II.html +++ b/Apps/Sandcastle/gallery/Natural Earth II.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,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 0de72ec6747a..a52fbe831bb9 100644 --- a/Apps/Sandcastle/gallery/Offline.html +++ b/Apps/Sandcastle/gallery/Offline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -40,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 657f566b4bbd..f8b31cc78bbf 100644 --- a/Apps/Sandcastle/gallery/PAMAP Terrain.html +++ b/Apps/Sandcastle/gallery/PAMAP Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -37,8 +37,9 @@ 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}`); } @@ -53,7 +54,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3324415110874286, 0.6954224325279967, - 236.6770689945084, + 236.6770689945084 ), orientation: { heading: Cesium.Math.toRadians(310), @@ -70,7 +71,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.358985133937573, 0.7123252393978314, - 451.05748252867375, + 451.05748252867375 ), orientation: { heading: Cesium.Math.toRadians(85), @@ -87,7 +88,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3700147546199826, 0.706808606166025, - 993.7916313325215, + 993.7916313325215 ), orientation: { heading: Cesium.Math.toRadians(90), @@ -104,7 +105,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.3218297501066052, 0.713358272291525, - 240.87968743408845, + 240.87968743408845 ), orientation: { heading: Cesium.Math.toRadians(200), @@ -121,7 +122,7 @@ destination: Cesium.Cartesian3.fromRadians( -1.349379633251472, 0.720297672225785, - 656.268309953562, + 656.268309953562 ), orientation: { heading: Cesium.Math.toRadians(200), @@ -132,14 +133,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 a0ff126bba0a..b28c438d6ac3 100644 --- a/Apps/Sandcastle/gallery/Parallels and Meridians.html +++ b/Apps/Sandcastle/gallery/Parallels and Meridians.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -120,13 +120,13 @@ minLatitude, midpoint, depth - 1, - color, + color ); const northernLines = makeParallelsRecursive( midpoint, maxLatitude, depth - 1, - color, + color ); result = southernLines.concat(result, northernLines); } @@ -144,13 +144,13 @@ minLongitude, midpoint, depth - 1, - color, + color ); const easternLines = makeMeridiansRecursive( midpoint, maxLongitude, depth - 1, - color, + color ); result = westernLines.concat(result, easternLines); } @@ -200,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); @@ -213,7 +213,7 @@ const antipode = new Cesium.Cartographic.fromDegrees( antipodeLongitude, antipodeLatitude, - 0, + 0 ); antipodalPoint.parallel = parallel(antipodeLatitude, cyan, finerGranularity); antipodalPoint.meridian = meridian(antipodeLongitude, cyan, finerGranularity); @@ -253,15 +253,13 @@ }); }); - Sandcastle.addToggleButton( - "Show higher-resolution grid", - false, - function (checked) { - primitives.higherResolutionGrid.forEach(function (line) { - line.show = checked; - }); - }, - ); + Sandcastle.addToggleButton("Show higher-resolution grid", false, function ( + checked + ) { + primitives.higherResolutionGrid.forEach(function (line) { + line.show = checked; + }); + }); Sandcastle.addToggleButton("Show antipodal point", false, function (checked) { showAntipodalPoint = checked; diff --git a/Apps/Sandcastle/gallery/Partial Ellipsoids.html b/Apps/Sandcastle/gallery/Partial Ellipsoids.html index c5830dbc3c18..4501bb694766 100644 --- a/Apps/Sandcastle/gallery/Partial Ellipsoids.html +++ b/Apps/Sandcastle/gallery/Partial Ellipsoids.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -49,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), @@ -69,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), @@ -175,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 7074b6d29d0d..6827cb692b7b 100644 --- a/Apps/Sandcastle/gallery/Particle System Fireworks.html +++ b/Apps/Sandcastle/gallery/Particle System Fireworks.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -39,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); @@ -73,32 +73,32 @@ 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); @@ -126,7 +126,7 @@ updateCallback: force, modelMatrix: modelMatrix, emitterModelMatrix: emitterModelMatrix, - }), + }) ); } @@ -178,7 +178,7 @@ time: Cesium.Math.nextRandomNumber() * lifetime, minimum: burstSize, maximum: burstSize, - }), + }) ); } @@ -193,7 +193,7 @@ const toFireworks = Cesium.Cartesian3.subtract( emitterInitialLocation, cameraOffset, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); Cesium.Cartesian3.normalize(toFireworks, toFireworks); const angle = diff --git a/Apps/Sandcastle/gallery/Particle System Tails.html b/Apps/Sandcastle/gallery/Particle System Tails.html index c854dc615b1c..de7c5ef8e691 100644 --- a/Apps/Sandcastle/gallery/Particle System Tails.html +++ b/Apps/Sandcastle/gallery/Particle System Tails.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -36,12 +36,12 @@ 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)); @@ -69,7 +69,7 @@ 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: { @@ -83,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 @@ -166,24 +166,24 @@ 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; @@ -210,10 +210,10 @@ 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); @@ -231,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 4e0315e5bf60..6fd2a46d64e1 100644 --- a/Apps/Sandcastle/gallery/Particle System Weather.html +++ b/Apps/Sandcastle/gallery/Particle System Weather.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,7 +41,7 @@ destination: new Cesium.Cartesian3( 277096.634865404, 5647834.481964232, - 2985563.7039122293, + 2985563.7039122293 ), orientation: { heading: 4.731089976107251, @@ -56,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; @@ -94,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; @@ -147,7 +147,7 @@ minimumImageSize: minimumSnowImageSize, maximumImageSize: maximumSnowImageSize, updateCallback: snowUpdate, - }), + }) ); scene.skyAtmosphere.hueShift = -0.8; @@ -181,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 c0e266a0f371..9e0acd78c955 100644 --- a/Apps/Sandcastle/gallery/Particle System.html +++ b/Apps/Sandcastle/gallery/Particle System.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -278,7 +278,7 @@ imageSize: new Cesium.Cartesian2( viewModel.particleSize, - viewModel.particleSize, + viewModel.particleSize ), emissionRate: viewModel.emissionRate, @@ -309,7 +309,7 @@ emitterModelMatrix: computeEmitterModelMatrix(), updateCallback: applyGravity, - }), + }) ); const gravityScratch = new Cesium.Cartesian3(); @@ -322,7 +322,7 @@ Cesium.Cartesian3.multiplyByScalar( gravityScratch, viewModel.gravity * dt, - gravityScratch, + gravityScratch ); p.velocity = Cesium.Cartesian3.add(p.velocity, gravityScratch, p.velocity); @@ -411,7 +411,7 @@ text: "Cone Emitter", onselect: function () { particleSystem.emitter = new Cesium.ConeEmitter( - Cesium.Math.toRadians(45.0), + Cesium.Math.toRadians(45.0) ); }, }, @@ -419,7 +419,7 @@ text: "Box Emitter", onselect: function () { particleSystem.emitter = new Cesium.BoxEmitter( - new Cesium.Cartesian3(10.0, 10.0, 10.0), + new Cesium.Cartesian3(10.0, 10.0, 10.0) ); }, }, diff --git a/Apps/Sandcastle/gallery/Per-Feature Post Processing.html b/Apps/Sandcastle/gallery/Per-Feature Post Processing.html index 33dccee7d666..40683ffc9ea8 100644 --- a/Apps/Sandcastle/gallery/Per-Feature Post Processing.html +++ b/Apps/Sandcastle/gallery/Per-Feature Post Processing.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -49,11 +49,11 @@ 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 9fbfe15631d2..22360ca405b1 100644 --- a/Apps/Sandcastle/gallery/Physically-Based Materials.html +++ b/Apps/Sandcastle/gallery/Physically-Based Materials.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -58,7 +58,7 @@ 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); @@ -84,7 +84,7 @@ destination: new Cesium.Cartesian3( -1371203.1456494154, -5508700.033950869, - 2901802.2749172337, + 2901802.2749172337 ), orientation: { heading: Cesium.Math.toRadians(67.64973594265429), @@ -98,7 +98,7 @@ destination: new Cesium.Cartesian3( -1371214.9554156072, -5508700.8494476415, - 2901826.794611029, + 2901826.794611029 ), orientation: { heading: Cesium.Math.toRadians(80.5354269423926), @@ -112,7 +112,7 @@ destination: new Cesium.Cartesian3( -1371190.7755780201, -5508732.668834588, - 2901827.2625979027, + 2901827.2625979027 ), orientation: { heading: Cesium.Math.toRadians(68.29411482061157), @@ -126,7 +126,7 @@ destination: new Cesium.Cartesian3( -1371052.4616855076, -5508691.745389906, - 2901861.440673151, + 2901861.440673151 ), orientation: { heading: Cesium.Math.toRadians(236.4536374528137), @@ -148,36 +148,40 @@ 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 939a265746f2..4f5d8072a52d 100644 --- a/Apps/Sandcastle/gallery/Picking.html +++ b/Apps/Sandcastle/gallery/Picking.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -63,15 +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 longitudeString = Cesium.Math.toDegrees( - cartographic.longitude, + cartographic.longitude ).toFixed(2); const latitudeString = Cesium.Math.toDegrees( - cartographic.latitude, + cartographic.latitude ).toFixed(2); entity.position = cartesian; @@ -83,7 +83,7 @@ entity.label.show = false; } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); - }, + } ); Sandcastle.addToolbarButton("Pick Entity", function () { @@ -125,7 +125,14 @@ 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, }, @@ -135,7 +142,14 @@ 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, }, @@ -145,7 +159,14 @@ 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, }, @@ -202,10 +223,10 @@ if (Cesium.defined(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); @@ -220,7 +241,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 56fff30f13e5..1596f5fe3e59 100644 --- a/Apps/Sandcastle/gallery/Plane.html +++ b/Apps/Sandcastle/gallery/Plane.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Points.html b/Apps/Sandcastle/gallery/Points.html index 57e81a71cc5f..4a7c50c7342d 100644 --- a/Apps/Sandcastle/gallery/Points.html +++ b/Apps/Sandcastle/gallery/Points.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Polygon.html b/Apps/Sandcastle/gallery/Polygon.html index 5d092754b07c..4d2535651468 100644 --- a/Apps/Sandcastle/gallery/Polygon.html +++ b/Apps/Sandcastle/gallery/Polygon.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,7 +38,16 @@ 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, }, @@ -48,7 +57,12 @@ 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, @@ -58,11 +72,25 @@ }); 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: [ @@ -80,17 +108,41 @@ }); 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, ]), }, @@ -124,8 +176,18 @@ 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, @@ -140,22 +202,50 @@ 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, ]), }, ], @@ -174,7 +264,15 @@ 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), @@ -187,7 +285,14 @@ 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 37b5ff8a4be4..83ea0c775c64 100644 --- a/Apps/Sandcastle/gallery/Polyline Dash.html +++ b/Apps/Sandcastle/gallery/Polyline Dash.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,7 +35,12 @@ 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({ @@ -48,7 +53,12 @@ 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({ @@ -62,7 +72,12 @@ 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({ @@ -76,7 +91,12 @@ 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({ @@ -90,7 +110,12 @@ 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 c8beddec1b8c..91a16f61f1c6 100644 --- a/Apps/Sandcastle/gallery/Polyline Volume.html +++ b/Apps/Sandcastle/gallery/Polyline Volume.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,8 +41,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians), - ), + radius * Math.sin(radians) + ) ); } return positions; @@ -56,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; @@ -66,7 +66,12 @@ 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, @@ -77,7 +82,15 @@ 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), @@ -96,7 +109,15 @@ 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 3bbcc7d43dc2..76f88d42b9f3 100644 --- a/Apps/Sandcastle/gallery/Polyline.html +++ b/Apps/Sandcastle/gallery/Polyline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -71,7 +71,12 @@ 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({ @@ -86,7 +91,12 @@ 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, @@ -98,7 +108,12 @@ 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 135dae3579af..8b500406ca35 100644 --- a/Apps/Sandcastle/gallery/Polylines on 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Polylines on 3D Tiles.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,7 +42,7 @@ destination: new Cesium.Cartesian3( 1234151.4883992162, -5086036.79436967, - 3633328.4278331124, + 3633328.4278331124 ), orientation: { heading: 5.593695742186853, @@ -103,8 +103,12 @@ 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({ @@ -129,9 +133,15 @@ 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, @@ -163,7 +173,7 @@ destination: new Cesium.Cartesian3( 1234151.4883992162, -5086036.79436967, - 3633328.4278331124, + 3633328.4278331124 ), orientation: { heading: 5.593695742186853, @@ -191,7 +201,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 3a8ceecf5b27..2f9844296788 100644 --- a/Apps/Sandcastle/gallery/Post Processing.html +++ b/Apps/Sandcastle/gallery/Post Processing.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -112,16 +112,16 @@ 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() { diff --git a/Apps/Sandcastle/gallery/Procedural Terrain.html b/Apps/Sandcastle/gallery/Procedural Terrain.html index ac3b11eb7452..82f58f2a407b 100644 --- a/Apps/Sandcastle/gallery/Procedural Terrain.html +++ b/Apps/Sandcastle/gallery/Procedural Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -147,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 5b3b8b9ce59f..a690f52e555d 100644 --- a/Apps/Sandcastle/gallery/Projection.html +++ b/Apps/Sandcastle/gallery/Projection.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Rectangle.html b/Apps/Sandcastle/gallery/Rectangle.html index 8c2e02d18391..9065086146bb 100644 --- a/Apps/Sandcastle/gallery/Rectangle.html +++ b/Apps/Sandcastle/gallery/Rectangle.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,7 +43,8 @@ }); 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), material: Cesium.Color.GREEN.withAlpha(0.5), diff --git a/Apps/Sandcastle/gallery/Resolution Scaling.html b/Apps/Sandcastle/gallery/Resolution Scaling.html index da1c5c8afc56..03acc594c490 100644 --- a/Apps/Sandcastle/gallery/Resolution Scaling.html +++ b/Apps/Sandcastle/gallery/Resolution Scaling.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Rotatable 2D Map.html b/Apps/Sandcastle/gallery/Rotatable 2D Map.html index d278a92753a5..52f0d49222f4 100644 --- a/Apps/Sandcastle/gallery/Rotatable 2D Map.html +++ b/Apps/Sandcastle/gallery/Rotatable 2D Map.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html b/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html index 01b4da3f5c64..dc50240b9a70 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -45,12 +45,12 @@ 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, }); @@ -68,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; @@ -84,7 +84,7 @@ cartesian1, cartesian2, offset, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); } diff --git a/Apps/Sandcastle/gallery/Scene Rendering Performance.html b/Apps/Sandcastle/gallery/Scene Rendering Performance.html index db130f98358a..35174723ccc0 100644 --- a/Apps/Sandcastle/gallery/Scene Rendering Performance.html +++ b/Apps/Sandcastle/gallery/Scene Rendering Performance.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -234,7 +234,7 @@ <h4>Max delta time</h4> viewModel.maximumRenderTimeChange = 10.0; viewer.dataSources.add( - Cesium.CzmlDataSource.load("../../SampleData/simple.czml"), + Cesium.CzmlDataSource.load("../../SampleData/simple.czml") ); viewer.clock.shouldAnimate = true; } diff --git a/Apps/Sandcastle/gallery/Sentinel-2.html b/Apps/Sandcastle/gallery/Sentinel-2.html index b9b6ce6ee1e0..d8d6ab1c6c1f 100644 --- a/Apps/Sandcastle/gallery/Sentinel-2.html +++ b/Apps/Sandcastle/gallery/Sentinel-2.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,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 92ab1573a711..ac7440a28a2a 100644 --- a/Apps/Sandcastle/gallery/Shadows.html +++ b/Apps/Sandcastle/gallery/Shadows.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -179,7 +179,7 @@ entity.position = Cesium.Cartesian3.fromRadians( longitude, latitude, - height + entity.height, + height + entity.height ); } @@ -253,16 +253,14 @@ viewer.terrainShadows = checked ? Cesium.ShadowMode.ENABLED : Cesium.ShadowMode.DISABLED; - }, + } ); - Sandcastle.addToggleButton( - "Soft Shadows", - shadowMap.softShadows, - function (checked) { - shadowMap.softShadows = checked; - }, - ); + Sandcastle.addToggleButton("Soft Shadows", shadowMap.softShadows, function ( + checked + ) { + shadowMap.softShadows = checked; + }); Sandcastle.addToolbarMenu([ { diff --git a/Apps/Sandcastle/gallery/Show or Hide Entities.html b/Apps/Sandcastle/gallery/Show or Hide Entities.html index 1933a5dd483f..6f695328cd21 100644 --- a/Apps/Sandcastle/gallery/Show or Hide Entities.html +++ b/Apps/Sandcastle/gallery/Show or Hide Entities.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html b/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html index 8f8a78064eda..2f036bd55f47 100644 --- a/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html +++ b/Apps/Sandcastle/gallery/Spheres and Ellipsoids.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/SplitDirection.html b/Apps/Sandcastle/gallery/SplitDirection.html index 65430d759424..26d7bdb608a5 100644 --- a/Apps/Sandcastle/gallery/SplitDirection.html +++ b/Apps/Sandcastle/gallery/SplitDirection.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/gallery/Star Burst.html b/Apps/Sandcastle/gallery/Star Burst.html index 89bbbe1b3687..8af17b39654f 100644 --- a/Apps/Sandcastle/gallery/Star Burst.html +++ b/Apps/Sandcastle/gallery/Star Burst.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -94,7 +94,7 @@ magnitude, lines, billboardEyeOffsets, - labelEyeOffsets, + labelEyeOffsets ) { const x = magnitude * Math.cos(angle); const y = magnitude * Math.sin(angle); @@ -108,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); @@ -117,12 +117,12 @@ drawingBufferHeight, distance, pixelRatio, - new Cesium.Cartesian2(), + new Cesium.Cartesian2() ); Cesium.Cartesian2.multiplyByScalar( offset, Cesium.Cartesian2.maximumComponent(dimensions), - offset, + offset ); let labelOffset; @@ -138,7 +138,7 @@ 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); @@ -216,7 +216,7 @@ magnitude, lines, billboardEyeOffsets, - labelEyeOffsets, + labelEyeOffsets ); pickedEntities.push(object); @@ -233,7 +233,7 @@ magnitude, lines, billboardEyeOffsets, - labelEyeOffsets, + labelEyeOffsets ); pickedEntities.push(object); } @@ -256,7 +256,7 @@ starBurstState.maxDimension = Math.max( pickedEntity.primitive.width, pickedEntity.primitive.height, - starBurstState.maxDimension, + starBurstState.maxDimension ); instances.push( @@ -268,10 +268,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE, + Cesium.Color.WHITE ), }, - }), + }) ); } @@ -283,7 +283,7 @@ translucent: false, }), asynchronous: false, - }), + }) ); viewer.selectedEntity = undefined; @@ -306,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; diff --git a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html index 0bc6d6d74ea1..083ffaef297a 100644 --- a/Apps/Sandcastle/gallery/Terrain Clipping Planes.html +++ b/Apps/Sandcastle/gallery/Terrain Clipping Planes.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -90,7 +90,7 @@ const position = Cesium.Cartesian3.fromRadians( -2.0862979473351286, 0.6586620013036164, - 1400.0, + 1400.0 ); const entity = viewer.entities.add({ @@ -137,72 +137,72 @@ new Cesium.Cartesian3( -2358434.3501556474, -3743554.5012105294, - 4581080.771684084, + 4581080.771684084 ), new Cesium.Cartesian3( -2357886.4482675144, -3744467.562778789, - 4581020.9199767085, + 4581020.9199767085 ), new Cesium.Cartesian3( -2357299.84353055, -3744954.0879047974, - 4581080.992360969, + 4581080.992360969 ), new Cesium.Cartesian3( -2356412.05169956, -3745385.3013702347, - 4580893.4737207815, + 4580893.4737207815 ), new Cesium.Cartesian3( -2355472.889436636, -3745256.5725702164, - 4581252.3128526565, + 4581252.3128526565 ), new Cesium.Cartesian3( -2354385.7458722834, -3744319.3823686405, - 4582372.770031389, + 4582372.770031389 ), new Cesium.Cartesian3( -2353758.788158616, -3743051.0128084184, - 4583356.453176038, + 4583356.453176038 ), new Cesium.Cartesian3( -2353663.8128999653, -3741847.9126874236, - 4584079.428665509, + 4584079.428665509 ), new Cesium.Cartesian3( -2354213.667592133, -3740784.50946316, - 4584502.428203525, + 4584502.428203525 ), new Cesium.Cartesian3( -2355596.239450013, -3739901.0226732804, - 4584515.9652557485, + 4584515.9652557485 ), new Cesium.Cartesian3( -2356942.4170108805, -3740342.454698685, - 4583686.690694482, + 4583686.690694482 ), new Cesium.Cartesian3( -2357529.554838029, -3740766.995076834, - 4583145.055348843, + 4583145.055348843 ), new Cesium.Cartesian3( -2358106.017822064, -3741439.438418052, - 4582452.293605261, + 4582452.293605261 ), new Cesium.Cartesian3( -2358539.5426236596, -3742680.720902901, - 4581692.0260975715, + 4581692.0260975715 ), ]; @@ -215,7 +215,7 @@ let midpoint = Cesium.Cartesian3.add( points[i], points[nextIndex], - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); midpoint = Cesium.Cartesian3.multiplyByScalar(midpoint, 0.5, midpoint); @@ -223,7 +223,7 @@ let right = Cesium.Cartesian3.subtract( points[nextIndex], midpoint, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); right = Cesium.Cartesian3.normalize(right, right); @@ -254,22 +254,22 @@ } // Adjust height so tileset is in terrain const cartographic = Cesium.Cartographic.fromCartesian( - tileset.boundingSphere.center, + tileset.boundingSphere.center ); const surface = Cesium.Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, - 0.0, + 0.0 ); const offset = Cesium.Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, - -20.0, + -20.0 ); const translation = Cesium.Cartesian3.subtract( offset, surface, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); @@ -284,7 +284,7 @@ const radius = boundingSphere.radius; viewer.camera.viewBoundingSphere( boundingSphere, - new Cesium.HeadingPitchRange(0.5, -0.2, radius * 4.0), + new Cesium.HeadingPitchRange(0.5, -0.2, radius * 4.0) ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } catch (error) { @@ -295,7 +295,7 @@ function loadGrandCanyon() { // Pick a position at the Grand Canyon const position = Cesium.Cartographic.toCartesian( - new Cesium.Cartographic.fromDegrees(-113.2665534, 36.0939345, 100), + new Cesium.Cartographic.fromDegrees(-113.2665534, 36.0939345, 100) ); const distance = 3000.0; const boundingSphere = new Cesium.BoundingSphere(position, distance); @@ -318,7 +318,7 @@ viewer.camera.viewBoundingSphere( boundingSphere, - new Cesium.HeadingPitchRange(0.5, -0.5, boundingSphere.radius * 5.0), + new Cesium.HeadingPitchRange(0.5, -0.5, boundingSphere.radius * 5.0) ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } diff --git a/Apps/Sandcastle/gallery/Terrain Exaggeration.html b/Apps/Sandcastle/gallery/Terrain Exaggeration.html index 4dcfd94d1189..436dc972c84a 100644 --- a/Apps/Sandcastle/gallery/Terrain Exaggeration.html +++ b/Apps/Sandcastle/gallery/Terrain Exaggeration.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -86,12 +86,12 @@ destination: new Cesium.Cartesian3( 336567.0354790703, 5664688.047602498, - 2923204.3566963132, + 2923204.3566963132 ), orientation: new Cesium.HeadingPitchRoll( 1.2273281382639265, -0.32239612370237514, - 0.0027207329018610338, + 0.0027207329018610338 ), }); @@ -99,7 +99,7 @@ position: new Cesium.Cartesian3( 314557.3531714575, 5659723.771882165, - 2923538.5417330978, + 2923538.5417330978 ), ellipsoid: { radii: new Cesium.Cartesian3(400.0, 400.0, 400.0), @@ -177,7 +177,7 @@ function (checked) { visualizeRelativeHeight = checked; updateMaterial(); - }, + } ); Sandcastle.addToolbarButton("Remove Exaggeration", function () { diff --git a/Apps/Sandcastle/gallery/Terrain.html b/Apps/Sandcastle/gallery/Terrain.html index 9867e52b0834..914262af69fb 100644 --- a/Apps/Sandcastle/gallery/Terrain.html +++ b/Apps/Sandcastle/gallery/Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -85,7 +85,7 @@ Cesium.Terrain.fromWorldTerrain({ requestWaterMask: true, requestVertexNormals: true, - }), + }) ); viewer.scene.globe.enableLighting = true; }, @@ -102,7 +102,7 @@ viewer.scene.setTerrain( Cesium.Terrain.fromWorldTerrain({ requestVertexNormals: true, - }), + }) ); viewer.scene.globe.enableLighting = true; }, @@ -113,7 +113,7 @@ viewer.scene.setTerrain( Cesium.Terrain.fromWorldTerrain({ requestWaterMask: true, - }), + }) ); }, }, @@ -138,9 +138,9 @@ "http://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/", { credit: "Terrain data courtesy VT MÄK", - }, - ), - ), + } + ) + ) ); }, }, @@ -150,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( @@ -174,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); @@ -191,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; @@ -212,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); @@ -269,7 +269,7 @@ everestLongitude - rectangleHalfSize, everestLatitude - rectangleHalfSize, everestLongitude + rectangleHalfSize, - everestLatitude + rectangleHalfSize, + everestLatitude + rectangleHalfSize ); const terrainSamplePositions = []; for (let y = 0; y < gridHeight; ++y) { @@ -288,27 +288,25 @@ viewer.scene.globe.enableLighting, function (checked) { viewer.scene.globe.enableLighting = checked; - }, + } ); - Sandcastle.addToggleButton( - "Enable fog", - viewer.scene.fog.enabled, - function (checked) { - viewer.scene.fog.enabled = checked; - }, - ); + Sandcastle.addToggleButton("Enable fog", viewer.scene.fog.enabled, function ( + checked + ) { + viewer.scene.fog.enabled = checked; + }); Sandcastle.addToolbarButton( "Sample Everest Terrain at Level 9", 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( @@ -316,7 +314,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; } @@ -324,12 +322,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 29f7f588d4be..150e8accbc93 100644 --- a/Apps/Sandcastle/gallery/Time Dynamic Point Cloud.html +++ b/Apps/Sandcastle/gallery/Time Dynamic Point Cloud.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -63,7 +63,7 @@ { iso8601Dates: dates, dataCallback: dataCallback, - }, + } ); const pointCloud = new Cesium.TimeDynamicPointCloud({ diff --git a/Apps/Sandcastle/gallery/Time Dynamic Wheels.html b/Apps/Sandcastle/gallery/Time Dynamic Wheels.html index 72e4aca8a98a..623f06efbae2 100644 --- a/Apps/Sandcastle/gallery/Time Dynamic Wheels.html +++ b/Apps/Sandcastle/gallery/Time Dynamic Wheels.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,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(); @@ -55,12 +55,12 @@ 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); @@ -75,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. @@ -84,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. @@ -111,7 +111,7 @@ return Cesium.Quaternion.fromAxisAngle( Cesium.Cartesian3.UNIT_X, wheelAngleProperty.getValue(time), - result, + result ); }, false); diff --git a/Apps/Sandcastle/gallery/Underground Color.html b/Apps/Sandcastle/gallery/Underground Color.html index ef52899aa286..aa7dcda925ee 100644 --- a/Apps/Sandcastle/gallery/Underground Color.html +++ b/Apps/Sandcastle/gallery/Underground Color.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -133,12 +133,12 @@ destination: new Cesium.Cartesian3( 3827058.651471591, -256575.7981065622, - 5078738.238484612, + 5078738.238484612 ), orientation: new Cesium.HeadingPitchRoll( 1.9765540737339418, -0.17352018581162754, - 0.0030147639151465455, + 0.0030147639151465455 ), endTransform: Cesium.Matrix4.IDENTITY, }); diff --git a/Apps/Sandcastle/gallery/Video.html b/Apps/Sandcastle/gallery/Video.html index e0112a310e49..b7853d2078d8 100644 --- a/Apps/Sandcastle/gallery/Video.html +++ b/Apps/Sandcastle/gallery/Video.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -99,7 +99,7 @@ sphere.ellipsoid.material.repeat = new Cesium.CallbackProperty(function ( time, - result, + result ) { if (!Cesium.defined(result)) { result = new Cesium.Cartesian2(); @@ -112,7 +112,8 @@ result.y = 1; } return result; - }, false); + }, + false); // Like Image, the video element doesn't have to be part of the DOM or // otherwise on the screen to be used as a texture. @@ -133,7 +134,7 @@ viewer.cesiumWidget.showErrorPanel( "This browser does not support cross-origin WebGL video textures.", "", - "", + "" ); }); diff --git a/Apps/Sandcastle/gallery/Voxel Picking.html b/Apps/Sandcastle/gallery/Voxel Picking.html index 18040bdca8c7..684395757bbc 100644 --- a/Apps/Sandcastle/gallery/Voxel Picking.html +++ b/Apps/Sandcastle/gallery/Voxel Picking.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,8 +46,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, @@ -157,8 +157,8 @@ Cesium.Cartesian3.fromElements( Cesium.Ellipsoid.WGS84.maximumRadius, Cesium.Ellipsoid.WGS84.maximumRadius, - Cesium.Ellipsoid.WGS84.maximumRadius, - ), + Cesium.Ellipsoid.WGS84.maximumRadius + ) ); const voxelPrimitive = scene.primitives.add( @@ -166,7 +166,7 @@ provider: provider, customShader: customShader, modelMatrix: modelMatrix, - }), + }) ); voxelPrimitive.nearestSampling = true; diff --git a/Apps/Sandcastle/gallery/Voxels.html b/Apps/Sandcastle/gallery/Voxels.html index f989109d1b0d..4f85411a9306 100644 --- a/Apps/Sandcastle/gallery/Voxels.html +++ b/Apps/Sandcastle/gallery/Voxels.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -32,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, @@ -121,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++) { @@ -152,25 +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++) { @@ -185,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 = @@ -215,7 +215,7 @@ provider: provider, customShader: customShader, modelMatrix: modelMatrix, - }), + }) ); viewer.voxelInspector.viewModel.voxelPrimitive = voxelPrimitive; @@ -250,8 +250,8 @@ Cesium.Cartesian3.fromElements( Cesium.Ellipsoid.WGS84.maximumRadius, Cesium.Ellipsoid.WGS84.maximumRadius, - Cesium.Ellipsoid.WGS84.maximumRadius, - ), + Cesium.Ellipsoid.WGS84.maximumRadius + ) ); Sandcastle.addToolbarMenu([ @@ -259,7 +259,7 @@ 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; @@ -270,7 +270,7 @@ text: "Cylinder - Procedural Tile", onselect: function () { const provider = new ProceduralSingleTileVoxelProvider( - Cesium.VoxelShapeType.CYLINDER, + Cesium.VoxelShapeType.CYLINDER ); const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, @@ -279,7 +279,7 @@ text: "Box - Procedural Tile", onselect: function () { const provider = new ProceduralSingleTileVoxelProvider( - Cesium.VoxelShapeType.BOX, + Cesium.VoxelShapeType.BOX ); const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, @@ -288,7 +288,7 @@ text: "Box - Procedural Tileset", onselect: function () { const provider = new ProceduralMultiTileVoxelProvider( - Cesium.VoxelShapeType.BOX, + Cesium.VoxelShapeType.BOX ); const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, @@ -297,7 +297,7 @@ text: "Box - 3D Tiles", onselect: async function () { const provider = await Cesium.Cesium3DTilesVoxelProvider.fromUrl( - "../../SampleData/Cesium3DTiles/Voxel/VoxelBox3DTiles/tileset.json", + "../../SampleData/Cesium3DTiles/Voxel/VoxelBox3DTiles/tileset.json" ); const primitive = createPrimitive(provider, customShaderWhite, modelMatrix); }, @@ -306,7 +306,7 @@ 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; @@ -317,12 +317,12 @@ 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 ); }, }, @@ -330,7 +330,7 @@ text: "Cylinder - Procedural Tileset", onselect: function () { const provider = new ProceduralMultiTileVoxelProvider( - Cesium.VoxelShapeType.CYLINDER, + Cesium.VoxelShapeType.CYLINDER ); const primitive = createPrimitive(provider, customShaderColor, modelMatrix); }, @@ -339,7 +339,7 @@ text: "Cylinder - 3D Tiles", onselect: async function () { const provider = await Cesium.Cesium3DTilesVoxelProvider.fromUrl( - "../../SampleData/Cesium3DTiles/Voxel/VoxelCylinder3DTiles/tileset.json", + "../../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 eb2f28622f5f..2859cc0b5806 100644 --- a/Apps/Sandcastle/gallery/Wall.html +++ b/Apps/Sandcastle/gallery/Wall.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,7 +35,12 @@ 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, @@ -46,8 +51,21 @@ 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, @@ -58,13 +76,41 @@ 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, + 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), diff --git a/Apps/Sandcastle/gallery/Washington DC 2017.html b/Apps/Sandcastle/gallery/Washington DC 2017.html index ecc36df2757d..6dab5ffe3883 100644 --- a/Apps/Sandcastle/gallery/Washington DC 2017.html +++ b/Apps/Sandcastle/gallery/Washington DC 2017.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -36,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 c93a28c028f8..18679dd944c3 100644 --- a/Apps/Sandcastle/gallery/Web Map Service (WMS).html +++ b/Apps/Sandcastle/gallery/Web Map Service (WMS).html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -34,13 +34,14 @@ // 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); 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 c8b0654f75eb..be2a6c5a7d67 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -62,7 +62,8 @@ // 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 9b2c7b01cc13..1999077d5b49 100644 --- a/Apps/Sandcastle/gallery/Z-Indexing Geometry.html +++ b/Apps/Sandcastle/gallery/Z-Indexing Geometry.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -90,13 +90,13 @@ 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)) { 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" ); } diff --git a/Apps/Sandcastle/gallery/development/3D Models Articulations.html b/Apps/Sandcastle/gallery/development/3D Models Articulations.html index c42eb44ba3d5..a633d6c6c478 100644 --- a/Apps/Sandcastle/gallery/development/3D Models Articulations.html +++ b/Apps/Sandcastle/gallery/development/3D Models Articulations.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -98,7 +98,7 @@ const origin = Cesium.Cartesian3.fromDegrees(-74.693, 28.243, height); const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( origin, - new Cesium.HeadingPitchRoll(), + new Cesium.HeadingPitchRoll() ); try { @@ -107,7 +107,7 @@ url: modelUrl, modelMatrix: modelMatrix, minimumPixelSize: 128, - }), + }) ); model.readyEvent.addEventListener(() => { @@ -121,50 +121,50 @@ const center = Cesium.Matrix4.multiplyByPoint( model.modelMatrix, Cesium.Cartesian3.ZERO, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); const heading = Cesium.Math.toRadians(0.0); const pitch = Cesium.Math.toRadians(-10.0); camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, r * 0.8)); const articulations = model.sceneGraph._runtimeArticulations; - viewModel.articulations = Object.keys(articulations).map( - function (articulationName) { - return { - name: articulationName, - stages: articulations[articulationName]._runtimeStages.map( - function (stage) { - const stageModel = { - name: stage.name, - minimum: stage.minimumValue, - maximum: stage.maximumValue, - current: stage.currentValue, - }; - Cesium.knockout.track(stageModel); - Cesium.knockout.defineProperty(stageModel, "currentText", { - get: function () { - return stageModel.current.toString(); - }, - set: function (value) { - // coerce values to number - stageModel.current = +value; - }, - }); - Cesium.knockout - .getObservable(stageModel, "current") - .subscribe(function (newValue) { - model.setArticulationStage( - `${articulationName} ${stage.name}`, - +stageModel.current, - ); - model.applyArticulations(); - }); - return stageModel; + viewModel.articulations = Object.keys(articulations).map(function ( + articulationName + ) { + return { + name: articulationName, + stages: articulations[articulationName]._runtimeStages.map(function ( + stage + ) { + const stageModel = { + name: stage.name, + minimum: stage.minimumValue, + maximum: stage.maximumValue, + current: stage.currentValue, + }; + Cesium.knockout.track(stageModel); + Cesium.knockout.defineProperty(stageModel, "currentText", { + get: function () { + return stageModel.current.toString(); }, - ), - }; - }, - ); + set: function (value) { + // coerce values to number + stageModel.current = +value; + }, + }); + Cesium.knockout + .getObservable(stageModel, "current") + .subscribe(function (newValue) { + model.setArticulationStage( + `${articulationName} ${stage.name}`, + +stageModel.current + ); + model.applyArticulations(); + }); + return stageModel; + }), + }; + }); viewModel.selectedArticulation = viewModel.articulations[0]; }); } catch (error) { diff --git a/Apps/Sandcastle/gallery/development/3D Models Node Explorer.html b/Apps/Sandcastle/gallery/development/3D Models Node Explorer.html index 3bca4af26abf..97bfe68c289a 100644 --- a/Apps/Sandcastle/gallery/development/3D Models Node Explorer.html +++ b/Apps/Sandcastle/gallery/development/3D Models Node Explorer.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -245,14 +245,14 @@ return new Cesium.Cartesian3( viewModel.translationX, viewModel.translationY, - viewModel.translationZ, + viewModel.translationZ ); }); Cesium.knockout.defineProperty(viewModel, "rotation", function () { const hpr = new Cesium.HeadingPitchRoll( viewModel.rotationHeading, viewModel.rotationPitch, - viewModel.rotationRoll, + viewModel.rotationRoll ); return Cesium.Quaternion.fromHeadingPitchRoll(hpr); }); @@ -260,7 +260,7 @@ return new Cesium.Cartesian3( viewModel.scaleX, viewModel.scaleY, - viewModel.scaleZ, + viewModel.scaleZ ); }); // this computed property combines the above properties into a single matrix to be applied to the node @@ -268,7 +268,7 @@ return Cesium.Matrix4.fromTranslationQuaternionRotationScale( viewModel.translation, viewModel.rotation, - viewModel.scale, + viewModel.scale ); }); @@ -282,7 +282,7 @@ const origin = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height); const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( origin, - new Cesium.HeadingPitchRoll(), + new Cesium.HeadingPitchRoll() ); try { @@ -291,7 +291,7 @@ url: modelUrl, modelMatrix: modelMatrix, minimumPixelSize: 128, - }), + }) ); model.readyEvent.addEventListener(() => { @@ -337,7 +337,7 @@ node.matrix = Cesium.Matrix4.multiply( node.originalMatrix, newValue, - new Cesium.Matrix4(), + new Cesium.Matrix4() ); }); }); diff --git a/Apps/Sandcastle/gallery/development/3D Models.html b/Apps/Sandcastle/gallery/development/3D Models.html index 0f8a01423422..8cf3ca4c5570 100644 --- a/Apps/Sandcastle/gallery/development/3D Models.html +++ b/Apps/Sandcastle/gallery/development/3D Models.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -125,14 +125,14 @@ Cesium.knockout.getObservable(viewModel, "color").subscribe(function (newValue) { model.color = Cesium.Color.fromAlpha( getColor(newValue), - Number(viewModel.alpha), + Number(viewModel.alpha) ); }); Cesium.knockout.getObservable(viewModel, "alpha").subscribe(function (newValue) { model.color = Cesium.Color.fromAlpha( getColor(viewModel.color), - Number(newValue), + Number(newValue) ); }); @@ -168,13 +168,13 @@ url: url, modelMatrix: modelMatrix, minimumPixelSize: 128, - }), + }) ); model.readyEvent.addEventListener(() => { model.color = Cesium.Color.fromAlpha( getColor(viewModel.color), - Number(viewModel.alpha), + Number(viewModel.alpha) ); model.colorBlendMode = getColorBlendMode(viewModel.colorBlendMode); model.colorBlendAmount = Number(viewModel.colorBlendAmount); @@ -196,7 +196,7 @@ const pitch = Cesium.Math.toRadians(-20.0); camera.lookAt( center, - new Cesium.HeadingPitchRange(heading, pitch, r * 2.0), + new Cesium.HeadingPitchRange(heading, pitch, r * 2.0) ); }); } catch (error) { @@ -232,7 +232,7 @@ height, heading, pitch, - roll, + roll ); }, }, @@ -248,7 +248,7 @@ height, heading, pitch, - roll, + roll ); }, }, diff --git a/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html b/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html index 5ac705074250..265157da2bda 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Performance Testing.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -72,12 +72,12 @@ Cesium.JulianDate.addSeconds( referenceMinimum, viewLoadTime, - referenceMaximum, + referenceMaximum ); tileset._heatmap.setReferenceMinimumMaximum( referenceMinimum, referenceMaximum, - heatmapTileProperty, + heatmapTileProperty ); } else if (heatmapTileProperty === "_priorityDeferred") { tileset._heatmap.setReferenceMinimumMaximum(-1, 1, heatmapTileProperty); @@ -93,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, @@ -119,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, @@ -146,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, @@ -169,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}` ); }; @@ -212,7 +212,7 @@ 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; @@ -248,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 10c3b2367a66..57592e417159 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Picking.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Picking.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -84,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 cdf56ad3ef46..a77025aee9c8 100644 --- a/Apps/Sandcastle/gallery/development/3D Tiles Split.html +++ b/Apps/Sandcastle/gallery/development/3D Tiles Split.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -208,8 +208,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) + ) ); const properties = tileset.properties; diff --git a/Apps/Sandcastle/gallery/development/BillboardClampToGround.html b/Apps/Sandcastle/gallery/development/BillboardClampToGround.html index 24ffb9a6daf5..37db7114bc15 100644 --- a/Apps/Sandcastle/gallery/development/BillboardClampToGround.html +++ b/Apps/Sandcastle/gallery/development/BillboardClampToGround.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,7 +43,7 @@ const billboardCollection = viewer.scene.primitives.add( new Cesium.BillboardCollection({ scene: viewer.scene, - }), + }) ); // seneca @@ -58,7 +58,7 @@ centerLongitude - rectangleHalfSize, centerLatitude - rectangleHalfSize, centerLongitude + rectangleHalfSize, - centerLatitude + rectangleHalfSize, + centerLatitude + rectangleHalfSize ); for (let y = 0; y < gridHeight; ++y) { @@ -81,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, diff --git a/Apps/Sandcastle/gallery/development/Billboards Instancing.html b/Apps/Sandcastle/gallery/development/Billboards Instancing.html index bc23457ef6e6..5a0bd16142f6 100644 --- a/Apps/Sandcastle/gallery/development/Billboards Instancing.html +++ b/Apps/Sandcastle/gallery/development/Billboards Instancing.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -58,7 +58,7 @@ centerLongitude - rectangleHalfSize, centerLatitude - rectangleHalfSize, centerLongitude + rectangleHalfSize, - centerLatitude + rectangleHalfSize, + centerLatitude + rectangleHalfSize ); function resetBillboardCollection() { @@ -69,7 +69,7 @@ billboardCollection = scene.primitives.add( new Cesium.BillboardCollection({ scene: scene, - }), + }) ); const gridSize = Math.sqrt(billboardCount); diff --git a/Apps/Sandcastle/gallery/development/Billboards.html b/Apps/Sandcastle/gallery/development/Billboards.html index d6f130787322..c845a643451c 100644 --- a/Apps/Sandcastle/gallery/development/Billboards.html +++ b/Apps/Sandcastle/gallery/development/Billboards.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -92,7 +92,7 @@ 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()); @@ -150,7 +150,7 @@ Sandcastle.declare(offsetByDistance); Promise.all([ Cesium.Resource.createIfNeeded( - "../images/Cesium_Logo_overlay.png", + "../images/Cesium_Logo_overlay.png" ).fetchImage(), Cesium.Resource.createIfNeeded("../images/facility.gif").fetchImage(), ]).then(function (images) { @@ -177,7 +177,7 @@ 1.0e3, 1.0, 1.5e6, - 0.0, + 0.0 ), translucencyByDistance: new Cesium.NearFarScalar(1.0e3, 1.0, 1.5e6, 0.1), }); diff --git a/Apps/Sandcastle/gallery/development/Box Outline.html b/Apps/Sandcastle/gallery/development/Box Outline.html index e185696d3b0b..4262a7222973 100644 --- a/Apps/Sandcastle/gallery/development/Box Outline.html +++ b/Apps/Sandcastle/gallery/development/Box Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -44,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. @@ -72,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 ed7ace760e45..08276aaea130 100644 --- a/Apps/Sandcastle/gallery/development/Box.html +++ b/Apps/Sandcastle/gallery/development/Box.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,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({ @@ -57,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) ), }, }); @@ -68,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 22779c6510a6..b752e50db420 100644 --- a/Apps/Sandcastle/gallery/development/Circle Outline.html +++ b/Apps/Sandcastle/gallery/development/Circle Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -57,7 +57,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); // Example 2: Draw a green extruded circle. @@ -89,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 2731dbd8b93b..1cdbd810a8ea 100644 --- a/Apps/Sandcastle/gallery/development/Circle.html +++ b/Apps/Sandcastle/gallery/development/Circle.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,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) ), }, }); @@ -62,7 +62,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }), + }) ); // Example 2: Draw a green extruded circle. @@ -82,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) ), }, }); @@ -93,7 +93,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }), + }) ); // Example 3: Draw a blue circle at a height. @@ -122,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 3f1a9a517ae5..523d8a724481 100644 --- a/Apps/Sandcastle/gallery/development/Coplanar Polygon Outline.html +++ b/Apps/Sandcastle/gallery/development/Coplanar Polygon Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,7 +38,17 @@ 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, ]), }), @@ -51,20 +61,50 @@ 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, ]), }, ], @@ -86,7 +126,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 996e034232d4..29252e61b596 100644 --- a/Apps/Sandcastle/gallery/development/Coplanar Polygon.html +++ b/Apps/Sandcastle/gallery/development/Coplanar Polygon.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,7 +35,17 @@ 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, ]), }); @@ -44,20 +54,50 @@ 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, ]), }, ], @@ -87,14 +127,24 @@ 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), }); @@ -110,7 +160,7 @@ material: Cesium.Material.fromType("Checkerboard"), 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 71437028faff..483d73e111d2 100644 --- a/Apps/Sandcastle/gallery/development/Corridor Outline.html +++ b/Apps/Sandcastle/gallery/development/Corridor Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -37,7 +37,12 @@ // 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, }); @@ -54,7 +59,12 @@ // 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, @@ -78,7 +88,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 38f2be361e6a..28691fb0394e 100644 --- a/Apps/Sandcastle/gallery/development/Corridor.html +++ b/Apps/Sandcastle/gallery/development/Corridor.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,7 +38,12 @@ // 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, @@ -50,7 +55,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) ), }, }); @@ -61,7 +66,7 @@ appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }), + }) ); // Example 2: Draw a green corridor at a height. @@ -72,7 +77,12 @@ // 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, @@ -96,7 +106,7 @@ closed: true, translucent: false, }), - }), + }) ); // Example 3: Draw a blue extruded corridor. @@ -107,7 +117,12 @@ // 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, @@ -121,7 +136,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) ), }, }); @@ -132,7 +147,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 64ab294f1f52..79b4ee41616a 100644 --- a/Apps/Sandcastle/gallery/development/Custom Primitive.html +++ b/Apps/Sandcastle/gallery/development/Custom Primitive.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -61,18 +61,18 @@ const cartesianPosition = Cesium.Cartographic.toCartesian( cartographicPosition, Cesium.Ellipsoid.WGS84, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); this.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( cartesianPosition, Cesium.Ellipsoid.WGS84, - new Cesium.Matrix4(), + new Cesium.Matrix4() ); this.halfWidthMeters = 10000; this.boundingSphere = new Cesium.BoundingSphere( cartesianPosition, - this.halfWidthMeters * Math.SQRT2, + this.halfWidthMeters * Math.SQRT2 ); this.time = undefined; @@ -150,7 +150,7 @@ bucket32 / width, (255 - bucket4) / width, 1.0, - scratchColor, + scratchColor ); textureTypedArray[4 * i] = 255 * color.red; textureTypedArray[4 * i + 1] = 255 * color.green; @@ -233,7 +233,7 @@ const positionTypedArray = generateVertices( primitive.faceResolution, - primitive.halfWidthMeters, + primitive.halfWidthMeters ); const positionVertexBuffer = Cesium.Buffer.createVertexBuffer({ context: context, @@ -245,8 +245,9 @@ index: positionLocation, vertexBuffer: positionVertexBuffer, componentsPerAttribute: 3, - componentDatatype: - Cesium.ComponentDatatype.fromTypedArray(positionTypedArray), + componentDatatype: Cesium.ComponentDatatype.fromTypedArray( + positionTypedArray + ), }; const indexCount = primitive.faceResolution * primitive.faceResolution * 6; diff --git a/Apps/Sandcastle/gallery/development/Cylinder Outline.html b/Apps/Sandcastle/gallery/development/Cylinder Outline.html index 19e97056046f..70f606fd6190 100644 --- a/Apps/Sandcastle/gallery/development/Cylinder Outline.html +++ b/Apps/Sandcastle/gallery/development/Cylinder Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,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 @@ -71,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 17bb0bdb6d70..627840b72568 100644 --- a/Apps/Sandcastle/gallery/development/Cylinder.html +++ b/Apps/Sandcastle/gallery/development/Cylinder.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -44,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({ @@ -70,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. @@ -98,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 fe1fa2a209dc..51e1ba3eeb9e 100644 --- a/Apps/Sandcastle/gallery/development/Display Conditions.html +++ b/Apps/Sandcastle/gallery/development/Display Conditions.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,19 +51,18 @@ }), 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) + ), + distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( + 0.0, + 5.5e6 ), - distanceDisplayCondition: - new Cesium.DistanceDisplayConditionGeometryInstanceAttribute( - 0.0, - 5.5e6, - ), }, }), appearance: new Cesium.PerInstanceColorAppearance({ closed: true, }), - }), + }) ); } @@ -73,7 +72,7 @@ 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, @@ -87,7 +86,7 @@ url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb", 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 6968c0d09b43..8f06bdfdc77b 100644 --- a/Apps/Sandcastle/gallery/development/Ellipse Outline.html +++ b/Apps/Sandcastle/gallery/development/Ellipse Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -84,7 +84,7 @@ 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 8599cfc898e2..bc38a6a665ec 100644 --- a/Apps/Sandcastle/gallery/development/Ellipse.html +++ b/Apps/Sandcastle/gallery/development/Ellipse.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -108,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 4a5e263e0dc8..8a35879c9b48 100644 --- a/Apps/Sandcastle/gallery/development/Ellipsoid Outline.html +++ b/Apps/Sandcastle/gallery/development/Ellipsoid Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,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({ @@ -68,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 65696cbbe6b8..24225944b166 100644 --- a/Apps/Sandcastle/gallery/development/Ellipsoid Surface.html +++ b/Apps/Sandcastle/gallery/development/Ellipsoid Surface.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,7 +51,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Stripe"), }), - }), + }) ); // Dot Material @@ -66,7 +66,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Dot"), }), - }), + }) ); // Checkerboard Material @@ -81,7 +81,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Checkerboard"), }), - }), + }) ); // Grid Material @@ -96,7 +96,7 @@ 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 00511b06226e..d6e599114489 100644 --- a/Apps/Sandcastle/gallery/development/Ellipsoid.html +++ b/Apps/Sandcastle/gallery/development/Ellipsoid.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,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({ @@ -67,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 dbd30f10b647..2658dc4461a8 100644 --- a/Apps/Sandcastle/gallery/development/Fog.html +++ b/Apps/Sandcastle/gallery/development/Fog.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -91,7 +91,7 @@ destination: new Cesium.Cartesian3( -2467730.5740817646, -4390507.315824514, - 3906155.113316938, + 3906155.113316938 ), orientation: { heading: 4.492211521856625, @@ -105,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 b5b1e72e4580..85374b4e1298 100644 --- a/Apps/Sandcastle/gallery/development/Frustum.html +++ b/Apps/Sandcastle/gallery/development/Frustum.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -40,7 +40,7 @@ Cesium.Matrix3.multiply( rotation, Cesium.Matrix3.fromRotationX(-Cesium.Math.PI_OVER_TWO), - rotation, + rotation ); const orientation = Cesium.Quaternion.fromRotationMatrix(rotation); @@ -62,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", @@ -75,7 +75,7 @@ closed: true, flat: true, }), - }), + }) ); scene.primitives.add( new Cesium.Primitive({ @@ -87,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(() => { @@ -102,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 356e5feed865..d34cfc70fa48 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 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,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({ @@ -61,7 +61,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) ), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, @@ -84,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; @@ -92,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({ @@ -107,7 +107,7 @@ modelMatrix: cylinderModelMatrix, 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) ), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, @@ -133,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, @@ -151,7 +151,7 @@ modelMatrix: ellipsoidModelMatrix, 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) ), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, @@ -178,7 +178,7 @@ closed: true, }), asynchronous: false, - }), + }) ); const o = scene.primitives.add( new Cesium.Primitive({ @@ -190,7 +190,7 @@ }, }), asynchronous: false, - }), + }) ); Sandcastle.addToolbarButton("Move box", function () { @@ -198,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 ); }); @@ -222,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 ); }); @@ -246,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 edc516c0f208..aa97b191d25d 100644 --- a/Apps/Sandcastle/gallery/development/Geometry Offset Attribute.html +++ b/Apps/Sandcastle/gallery/development/Geometry Offset Attribute.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -44,7 +44,7 @@ let offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center1), 100000, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); const i1 = new Cesium.GeometryInstance({ @@ -58,7 +58,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) ), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, @@ -92,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 ), }, }); @@ -110,7 +110,7 @@ attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3( - Cesium.Cartesian3.ZERO, + Cesium.Cartesian3.ZERO ), }, }); @@ -121,7 +121,7 @@ offset = Cesium.Cartesian3.multiplyByScalar( ellipsoid.geodeticSurfaceNormal(center3), 100000, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); const i3 = new Cesium.GeometryInstance({ id: id3, @@ -134,7 +134,7 @@ }), 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) ), offset: Cesium.OffsetGeometryInstanceAttribute.fromCartesian3(offset), }, @@ -160,7 +160,7 @@ closed: true, }), asynchronous: false, - }), + }) ); const o = scene.primitives.add( new Cesium.Primitive({ @@ -172,7 +172,7 @@ }, }), asynchronous: false, - }), + }) ); Sandcastle.addToolbarButton("1", function () { @@ -180,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 () { @@ -203,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 () { @@ -226,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 88e0caca9a95..9573046c0070 100644 --- a/Apps/Sandcastle/gallery/development/Geometry and Appearances.html +++ b/Apps/Sandcastle/gallery/development/Geometry and Appearances.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -37,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. @@ -60,7 +60,16 @@ }); 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({ @@ -135,7 +144,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Stripe"), }), - }), + }) ); primitives.add( new Cesium.Primitive({ @@ -152,7 +161,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); // Create extruded rectangle @@ -166,7 +175,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -200,7 +209,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -221,7 +230,14 @@ // 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; @@ -235,7 +251,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -256,10 +272,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({ @@ -271,7 +287,7 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -299,7 +315,7 @@ translucent: false, closed: true, }), - }), + }) ); primitives.add( new Cesium.Primitive({ @@ -316,7 +332,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); // Create box and ellipsoid boxes, and use the instance's @@ -363,35 +379,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( @@ -400,10 +416,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({ @@ -412,7 +428,7 @@ attributes: { color: solidWhite, }, - }), + }) ); instances.push( @@ -421,10 +437,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({ @@ -433,7 +449,7 @@ attributes: { color: solidWhite, }, - }), + }) ); instances.push( @@ -442,10 +458,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({ @@ -454,7 +470,7 @@ attributes: { color: solidWhite, }, - }), + }) ); } @@ -465,7 +481,7 @@ translucent: false, closed: true, }), - }), + }) ); primitives.add( new Cesium.Primitive({ @@ -477,12 +493,17 @@ 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]; @@ -496,7 +517,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }), + Cesium.Color.fromRandom({ alpha: 0.7 }) ), }, }); @@ -516,7 +537,7 @@ new Cesium.Primitive({ geometryInstances: wallInstance, appearance: new Cesium.PerInstanceColorAppearance(), - }), + }) ); primitives.add( new Cesium.Primitive({ @@ -528,7 +549,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); rectangle = Cesium.Rectangle.fromDegrees(-92.0, 30.0, -85.0, 40.0); @@ -541,22 +562,50 @@ 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, ]), }, ], @@ -607,7 +656,7 @@ appearance: new Cesium.EllipsoidSurfaceAppearance({ material: Cesium.Material.fromType("Stripe"), }), - }), + }) ); // Create extruded rectangle @@ -625,7 +674,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -649,7 +698,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -657,7 +706,16 @@ // 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; @@ -669,7 +727,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -680,10 +738,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({ @@ -695,7 +753,7 @@ modelMatrix: modelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -712,7 +770,7 @@ translucent: false, closed: true, }), - }), + }) ); // Combine instances each with a unique color. @@ -736,10 +794,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }), + Cesium.Color.fromRandom({ alpha: 0.5 }) ), }, - }), + }) ); instances.push( @@ -751,10 +809,10 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }), + Cesium.Color.fromRandom({ alpha: 0.5 }) ), }, - }), + }) ); } @@ -762,7 +820,7 @@ new Cesium.Primitive({ geometryInstances: instances, appearance: new Cesium.PerInstanceColorAppearance(), - }), + }) ); // Create box and ellipsoid boxes, and use the instance's @@ -792,35 +850,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({ @@ -828,10 +886,10 @@ modelMatrix: boxModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }), + Cesium.Color.fromRandom({ alpha: 0.5 }) ), }, - }), + }) ); instances.push( @@ -840,10 +898,10 @@ modelMatrix: ellipsoidModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }), + Cesium.Color.fromRandom({ alpha: 0.5 }) ), }, - }), + }) ); instances.push( @@ -852,10 +910,10 @@ modelMatrix: sphereModelMatrix, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.5 }), + Cesium.Color.fromRandom({ alpha: 0.5 }) ), }, - }), + }) ); } @@ -866,7 +924,7 @@ translucent: true, closed: true, }), - }), + }) ); positions = []; @@ -892,7 +950,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); // create a polyline with a material @@ -913,7 +971,7 @@ appearance: new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType), }), - }), + }) ); // create a polyline with per segment colors @@ -935,7 +993,7 @@ }), }), appearance: new Cesium.PolylineColorAppearance(), - }), + }) ); // create a polyline with per vertex colors @@ -958,13 +1016,26 @@ }), }), 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({ @@ -981,11 +1052,16 @@ 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; @@ -997,7 +1073,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -1012,7 +1088,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }), + Cesium.Color.fromRandom({ alpha: 0.7 }) ), }, }); @@ -1037,7 +1113,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 0.7 }), + Cesium.Color.fromRandom({ alpha: 0.7 }) ), }, }); @@ -1049,7 +1125,7 @@ translucent: true, closed: true, }), - }), + }) ); primitives.add( @@ -1062,7 +1138,7 @@ lineWidth: Math.min(4.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); function starPositions(arms, rOuter, rInner) { @@ -1072,7 +1148,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); } @@ -1080,7 +1156,15 @@ } 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({ @@ -1090,7 +1174,7 @@ }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromRandom({ alpha: 1.0 }), + Cesium.Color.fromRandom({ alpha: 1.0 }) ), }, }); @@ -1108,14 +1192,19 @@ 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 }) ), }, }); @@ -1127,8 +1216,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians), - ), + radius * Math.sin(radians) + ) ); } return positions; @@ -1137,7 +1226,12 @@ 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), @@ -1154,7 +1248,7 @@ translucent: false, closed: true, }), - }), + }) ); primitives.add( @@ -1167,7 +1261,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 5ec25c8d9fa3..70db006bb48c 100644 --- a/Apps/Sandcastle/gallery/development/Ground Polyline Material.html +++ b/Apps/Sandcastle/gallery/development/Ground Polyline Material.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -47,7 +47,10 @@ 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, }), @@ -55,7 +58,7 @@ appearance: new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType), }), - }), + }) ); // Polyline Dash @@ -64,7 +67,10 @@ 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, }), @@ -72,7 +78,7 @@ appearance: new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineDashType), }), - }), + }) ); // Polyline Outline @@ -81,7 +87,10 @@ 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, }), @@ -89,12 +98,12 @@ appearance: new Cesium.PolylineMaterialAppearance({ 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 d16604d836fe..f089350806d7 100644 --- a/Apps/Sandcastle/gallery/development/Ground Primitive Materials.html +++ b/Apps/Sandcastle/gallery/development/Ground Primitive Materials.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -462,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, @@ -487,7 +487,7 @@ aboveGround: false, }), classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); worldRectangle = scene.primitives.add( @@ -503,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 03d9ea3307a3..6b99970be924 100644 --- a/Apps/Sandcastle/gallery/development/Ground Primitive.html +++ b/Apps/Sandcastle/gallery/development/Ground Primitive.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -55,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 }; @@ -92,7 +92,7 @@ id: "polygon 1", }), classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); // Same polygon slightly offset and overlapping. @@ -116,7 +116,7 @@ id: "polygon 2", }), classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); // Same polygon slightly offset and overlapping. @@ -140,7 +140,7 @@ id: "polygon 3", }), classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); } @@ -149,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); } @@ -175,20 +175,20 @@ 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)) { currentObject.primitive.getGeometryInstanceAttributes( - currentObject.id, + currentObject.id ).color = lastColor; currentObject = undefined; } @@ -241,7 +241,7 @@ show: show, }, id: `rectangle${i}`, - }), + }) ); } @@ -256,7 +256,7 @@ new Cesium.GroundPrimitive({ geometryInstances: instances, classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); viewOverlappingPolygons(); @@ -271,7 +271,7 @@ new Cesium.GroundPrimitive({ geometryInstances: instances, classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); color = new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 1.0, 0.5); @@ -288,7 +288,7 @@ new Cesium.GroundPrimitive({ geometryInstances: instances, classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); viewOverlappingPolygons(); @@ -306,7 +306,7 @@ if (Cesium.defined(currentObject)) { primitive.getGeometryInstanceAttributes(currentObject.id).show = [1]; pickPrimitive.getGeometryInstanceAttributes( - pickIdPrefix + currentObject.id, + pickIdPrefix + currentObject.id ).show = [0]; } @@ -314,12 +314,12 @@ 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]; pickPrimitive.getGeometryInstanceAttributes( - pickIdPrefix + currentObject.id, + pickIdPrefix + currentObject.id ).show = [0]; currentObject = undefined; } @@ -337,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 @@ -357,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 @@ -372,19 +372,24 @@ 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 @@ -397,13 +402,13 @@ }), 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 @@ -413,20 +418,27 @@ 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, - }), + }) ); }); @@ -437,7 +449,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 fcb2ba0e213e..babbda29980f 100644 --- a/Apps/Sandcastle/gallery/development/Labels.html +++ b/Apps/Sandcastle/gallery/development/Labels.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -127,7 +127,7 @@ 1.5e2, 3.0, 1.5e7, - 0.5, + 0.5 ), }); }; diff --git a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html index d3ea8f944f94..e453d0952fa8 100644 --- a/Apps/Sandcastle/gallery/development/Many Clipping Planes.html +++ b/Apps/Sandcastle/gallery/development/Many Clipping Planes.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -149,7 +149,7 @@ Cesium.Cartesian3.normalize(dir, dir); const newPlane = new Cesium.ClippingPlane( dir, - cylinderRadius * radiusMultiplier, + cylinderRadius * radiusMultiplier ); modelEntityClippingPlanes.add(newPlane); clippingPlanes.push(newPlane); @@ -222,24 +222,24 @@ const surface = Cesium.Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, - 0.0, + 0.0 ); const offset = Cesium.Cartesian3.fromRadians( cartographic.longitude, cartographic.latitude, - height, + height ); const translation = Cesium.Cartesian3.subtract( offset, surface, - new Cesium.Cartesian3(), + new Cesium.Cartesian3() ); tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); const radius = boundingSphere.radius; viewer.camera.viewBoundingSphere( boundingSphere, - new Cesium.HeadingPitchRange(0.5, -0.2, radius * 4.0), + new Cesium.HeadingPitchRange(0.5, -0.2, radius * 4.0) ); viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY); } @@ -272,7 +272,7 @@ // eslint-disable-next-line no-loss-of-precision -2.0872979473351286, 0.6596620013036164, - 2380.0, + 2380.0 ); const entity = viewer.entities.add({ position: position, diff --git a/Apps/Sandcastle/gallery/development/Material.html b/Apps/Sandcastle/gallery/development/Material.html index 320dab4e9e1f..3c713874c162 100644 --- a/Apps/Sandcastle/gallery/development/Material.html +++ b/Apps/Sandcastle/gallery/development/Material.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,7 +38,12 @@ 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, @@ -48,7 +53,7 @@ material: Cesium.Material.fromType("Checkerboard"), materialSupport: Cesium.MaterialAppearance.MaterialSupport.TEXTURED, }), - }), + }) ); // Striped Wall @@ -57,7 +62,12 @@ 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, @@ -67,7 +77,7 @@ material: Cesium.Material.fromType("Stripe"), 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 c64366e2eba8..20b8cd3ba97d 100644 --- a/Apps/Sandcastle/gallery/development/Multiple Shadows.html +++ b/Apps/Sandcastle/gallery/development/Multiple Shadows.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -76,9 +76,9 @@ url: "../../SampleData/models/ShadowTester/Shadow_Tester_Point.glb", modelMatrix: Cesium.Transforms.headingPitchRollToFixedFrame( center, - new Cesium.HeadingPitchRoll(heading, 0.0, 0.0), + new Cesium.HeadingPitchRoll(heading, 0.0, 0.0) ), - }), + }) ); model.readyEvent.addEventListener(() => { diff --git a/Apps/Sandcastle/gallery/development/Per Instance Color.html b/Apps/Sandcastle/gallery/development/Per Instance Color.html index 388847fe1c1c..0ec5b0c9bfff 100644 --- a/Apps/Sandcastle/gallery/development/Per Instance Color.html +++ b/Apps/Sandcastle/gallery/development/Per Instance Color.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -42,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 }) ), }, - }), + }) ); } @@ -59,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 a28e72fa6ad9..42e48ff5379a 100644 --- a/Apps/Sandcastle/gallery/development/Pick From Ray.html +++ b/Apps/Sandcastle/gallery/development/Pick From Ray.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,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." ); } @@ -47,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); @@ -63,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({ @@ -110,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) { @@ -128,7 +128,7 @@ pickedFeatures.push(object); object.color = Cesium.Color.fromAlpha( Cesium.Color.YELLOW, - object.color.alpha, + object.color.alpha ); } intersectionMarkers.push( @@ -138,7 +138,7 @@ radii: new Cesium.Cartesian3(3.0, 3.0, 3.0), material: Cesium.Color.RED, }, - }), + }) ); } } @@ -149,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 eba7b1729c50..348e7fafe3ce 100644 --- a/Apps/Sandcastle/gallery/development/Picking.html +++ b/Apps/Sandcastle/gallery/development/Picking.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -123,7 +123,12 @@ 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, @@ -149,32 +154,43 @@ 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, }), 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); }, @@ -219,25 +235,31 @@ }), 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); }, @@ -249,7 +271,7 @@ const hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(135), 0, 0); const orientation = Cesium.Transforms.headingPitchRollQuaternion( position, - hpr, + hpr ); const entity = viewer.entities.add({ @@ -288,8 +310,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); @@ -326,8 +348,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,8 +386,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({ @@ -410,22 +432,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); @@ -462,22 +484,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); diff --git a/Apps/Sandcastle/gallery/development/PointPrimitives.html b/Apps/Sandcastle/gallery/development/PointPrimitives.html index 68c365e32c20..30d6724c4bee 100644 --- a/Apps/Sandcastle/gallery/development/PointPrimitives.html +++ b/Apps/Sandcastle/gallery/development/PointPrimitives.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -36,7 +36,7 @@ Sandcastle.declare(addPointPrimitive); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection(), + new Cesium.PointPrimitiveCollection() ); pointPrimitives.add({ color: Cesium.Color.YELLOW, @@ -48,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), @@ -64,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 @@ -82,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), @@ -105,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), @@ -120,7 +120,7 @@ Sandcastle.declare(fadeByDistance); const pointPrimitives = scene.primitives.add( - new Cesium.PointPrimitiveCollection(), + new Cesium.PointPrimitiveCollection() ); pointPrimitives.add({ position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), @@ -133,7 +133,7 @@ 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); @@ -170,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; @@ -180,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 4559da04f5db..f6af7d62013e 100644 --- a/Apps/Sandcastle/gallery/development/Polygon Outline.html +++ b/Apps/Sandcastle/gallery/development/Polygon Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -35,7 +35,16 @@ // 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({ @@ -53,12 +62,26 @@ // 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, ]), }, ], @@ -77,7 +100,15 @@ // 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. @@ -105,7 +136,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 54a6bbd307c0..717c03f2cd84 100644 --- a/Apps/Sandcastle/gallery/development/Polygon Texture Coordinates.html +++ b/Apps/Sandcastle/gallery/development/Polygon Texture Coordinates.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,7 +38,16 @@ // 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: [ @@ -60,27 +69,62 @@ // 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, ]), }, ], @@ -146,14 +190,37 @@ // 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, ]), }, ], @@ -188,7 +255,16 @@ // 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: [ @@ -210,7 +286,16 @@ // 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: [ @@ -232,8 +317,21 @@ // 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: [ @@ -277,13 +375,20 @@ 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: [ @@ -314,7 +419,7 @@ }), }), classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polygon.html b/Apps/Sandcastle/gallery/development/Polygon.html index a229fcbe3219..37352c2ab853 100644 --- a/Apps/Sandcastle/gallery/development/Polygon.html +++ b/Apps/Sandcastle/gallery/development/Polygon.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,7 +41,16 @@ // 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({ @@ -61,22 +70,50 @@ // 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, ]), }, ], @@ -101,7 +138,12 @@ // 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({ @@ -118,7 +160,17 @@ // 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 @@ -142,13 +194,36 @@ 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, ]), }, @@ -186,8 +261,21 @@ 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, ]), }; @@ -227,7 +315,7 @@ closed: true, translucent: false, }), - }), + }) ); // Add each textured polygon instance to primitives. @@ -250,7 +338,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 16245f14dc75..014965e9ec2b 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Color.html +++ b/Apps/Sandcastle/gallery/development/Polyline Color.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -54,7 +54,7 @@ }), }), appearance: new Cesium.PolylineColorAppearance(), - }), + }) ); // Example 2: Draw a polyline with per vertex colors @@ -79,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 d90b700cf251..687b1ff59330 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Material.html +++ b/Apps/Sandcastle/gallery/development/Polyline Material.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,7 +41,10 @@ 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, @@ -50,7 +53,7 @@ appearance: new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineGlowType), }), - }), + }) ); // Polyline Arrow @@ -59,7 +62,10 @@ 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, @@ -68,7 +74,7 @@ appearance: new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineArrowType), }), - }), + }) ); // Polyline Outline @@ -77,7 +83,10 @@ 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, @@ -86,7 +95,7 @@ appearance: new Cesium.PolylineMaterialAppearance({ 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 367c3919286f..d7f2e8550df4 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Volume Outline.html +++ b/Apps/Sandcastle/gallery/development/Polyline Volume Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -50,7 +50,12 @@ 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, @@ -70,7 +75,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); } @@ -80,7 +85,10 @@ 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, @@ -100,7 +108,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 d156688778e6..54902d10fb88 100644 --- a/Apps/Sandcastle/gallery/development/Polyline Volume.html +++ b/Apps/Sandcastle/gallery/development/Polyline Volume.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -46,8 +46,8 @@ positions.push( new Cesium.Cartesian2( radius * Math.cos(radians), - radius * Math.sin(radians), - ), + radius * Math.sin(radians) + ) ); } return positions; @@ -57,7 +57,12 @@ 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), @@ -83,7 +88,15 @@ 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(), @@ -104,7 +117,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); } @@ -114,7 +127,15 @@ 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), @@ -133,7 +154,7 @@ translucent: false, closed: true, }), - }), + }) ); //Sandcastle_End }; diff --git a/Apps/Sandcastle/gallery/development/Polyline.html b/Apps/Sandcastle/gallery/development/Polyline.html index 7f06a46b4d8a..b922f615a8c2 100644 --- a/Apps/Sandcastle/gallery/development/Polyline.html +++ b/Apps/Sandcastle/gallery/development/Polyline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -40,19 +40,22 @@ 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 @@ -65,7 +68,12 @@ 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, @@ -76,7 +84,7 @@ }, }), 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 131f60edaa34..505a500bc4d2 100644 --- a/Apps/Sandcastle/gallery/development/Polylines On Terrain.html +++ b/Apps/Sandcastle/gallery/development/Polylines On Terrain.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -82,8 +82,9 @@ .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]; } @@ -100,7 +101,7 @@ -112.1340164450331, 36.05494287836128, -112.0840164450331, - 36.10494287836128, + 36.10494287836128 ), vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, }), @@ -111,7 +112,7 @@ material: Cesium.Material.fromType("Color"), }), classificationType: Cesium.ClassificationType.TERRAIN, - }), + }) ); const leftHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas); @@ -124,8 +125,9 @@ 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 { @@ -155,9 +157,16 @@ ]); 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) { @@ -171,7 +180,7 @@ attributes: { show: new Cesium.ShowGeometryInstanceAttribute(), color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("green").withAlpha(0.7), + Cesium.Color.fromCssColorString("green").withAlpha(0.7) ), }, }); @@ -186,7 +195,7 @@ attributes: { show: new Cesium.ShowGeometryInstanceAttribute(), color: Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.fromCssColorString("#67ADDF").withAlpha(0.7), + Cesium.Color.fromCssColorString("#67ADDF").withAlpha(0.7) ), }, }); @@ -235,19 +244,22 @@ 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]; } }); @@ -272,7 +284,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 9452881f2ce7..9c46b1978885 100644 --- a/Apps/Sandcastle/gallery/development/Polylines.html +++ b/Apps/Sandcastle/gallery/development/Polylines.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -47,7 +47,14 @@ 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, { @@ -75,7 +82,14 @@ 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, @@ -103,7 +117,12 @@ 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, diff --git a/Apps/Sandcastle/gallery/development/Rectangle Outline.html b/Apps/Sandcastle/gallery/development/Rectangle Outline.html index 6daf5da78dbc..0bac394baad6 100644 --- a/Apps/Sandcastle/gallery/development/Rectangle Outline.html +++ b/Apps/Sandcastle/gallery/development/Rectangle Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -55,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 eb16c7cafccf..4d114c0f41b7 100644 --- a/Apps/Sandcastle/gallery/development/Rectangle.html +++ b/Apps/Sandcastle/gallery/development/Rectangle.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,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) ), }, }); @@ -62,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) ), }, }); @@ -74,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 442a3a8bd60e..9d7d2a336186 100644 --- a/Apps/Sandcastle/gallery/development/Shadows.html +++ b/Apps/Sandcastle/gallery/development/Shadows.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -282,16 +282,16 @@ this.type = options.type; this.polygonOffset = Cesium.knockout.observable(options.polygonOffset); this.polygonOffsetFactor = Cesium.knockout.observable( - options.polygonOffsetFactor, + options.polygonOffsetFactor ); this.polygonOffsetUnits = Cesium.knockout.observable( - options.polygonOffsetUnits, + options.polygonOffsetUnits ); this.normalOffset = Cesium.knockout.observable(options.normalOffset); this.normalOffsetScale = Cesium.knockout.observable(options.normalOffsetScale); this.normalShading = Cesium.knockout.observable(options.normalShading); this.normalShadingSmooth = Cesium.knockout.observable( - options.normalShadingSmooth, + options.normalShadingSmooth ); this.depthBias = Cesium.knockout.observable(options.depthBias); } @@ -537,7 +537,7 @@ const center = Cesium.Cartesian3.fromRadians( location.centerLongitude, location.centerLatitude, - location.height, + location.height ); const lightHorizon = Cesium.Math.toRadians(viewModel.lightHorizon); const lightAngle = Cesium.Math.toRadians(viewModel.lightAngle); @@ -590,7 +590,7 @@ globe.shadows = Cesium.ShadowMode.fromCastReceive( viewModel.terrainCast, - viewModel.terrainReceive, + viewModel.terrainReceive ); globe.show = viewModel.globe; scene.skyAtmosphere.show = viewModel.globe; @@ -708,7 +708,7 @@ const updatedPositions = await Cesium.sampleTerrain( terrainProvider, 11, - positions, + positions ); location.height = updatedPositions[0].height + getModelPosition(); } catch (error) { @@ -725,7 +725,7 @@ const center = Cesium.Cartesian3.fromRadians( location.centerLongitude, location.centerLatitude, - location.height, + location.height ); const frustumSize = 55.0; @@ -768,22 +768,22 @@ const position1 = Cesium.Cartesian3.fromRadians( centerLongitude, centerLatitude, - height + 5.0, + height + 5.0 ); const position2 = Cesium.Cartesian3.fromRadians( centerLongitude, centerLatitude, - height + 10.0, + height + 10.0 ); const position3 = Cesium.Cartesian3.fromRadians( centerLongitude, centerLatitude, - height + 15.0, + height + 15.0 ); const modelPosition = Cesium.Cartesian3.fromRadians( centerLongitude, centerLatitude, - height, + height ); createModel(uiOptions.modelUrls[viewModel.model], modelPosition); @@ -827,7 +827,7 @@ async function createModel(url, origin) { const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( origin, - new Cesium.HeadingPitchRoll(), + new Cesium.HeadingPitchRoll() ); try { @@ -835,7 +835,7 @@ await Cesium.Model.fromGltfAsync({ url: url, modelMatrix: modelMatrix, - }), + }) ); model.readyEvent.addEventListener(() => { @@ -855,14 +855,14 @@ function createBoxRTC(origin) { const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( origin, - new Cesium.HeadingPitchRoll(), + new Cesium.HeadingPitchRoll() ); const boxGeometry = Cesium.BoxGeometry.createGeometry( Cesium.BoxGeometry.fromDimensions({ vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, dimensions: new Cesium.Cartesian3(1.0, 1.0, 1.0), - }), + }) ); const positions = boxGeometry.attributes.position.values; @@ -877,7 +877,7 @@ Cesium.BoundingSphere.transform( boxGeometry.boundingSphere, modelMatrix, - boxGeometry.boundingSphere, + boxGeometry.boundingSphere ); const boxGeometryInstance = new Cesium.GeometryInstance({ @@ -904,7 +904,7 @@ function createBox(origin) { const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( origin, - new Cesium.HeadingPitchRoll(), + new Cesium.HeadingPitchRoll() ); const box = new Cesium.Primitive({ @@ -932,7 +932,7 @@ function createSphere(origin) { const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame( origin, - new Cesium.HeadingPitchRoll(), + new Cesium.HeadingPitchRoll() ); const sphere = new Cesium.Primitive({ @@ -944,7 +944,7 @@ modelMatrix: modelMatrix, 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) ), }, }), @@ -974,11 +974,11 @@ if (Cesium.defined(picked) && Cesium.defined(picked.primitive)) { const castShadows = Cesium.ShadowMode.castShadows(picked.primitive.shadows); const receiveShadows = Cesium.ShadowMode.receiveShadows( - picked.primitive.shadows, + picked.primitive.shadows ); picked.primitive.shadows = Cesium.ShadowMode.fromCastReceive( !castShadows, - receiveShadows, + receiveShadows ); } }, Cesium.ScreenSpaceEventType.LEFT_CLICK); @@ -989,11 +989,11 @@ if (Cesium.defined(picked)) { const castShadows = Cesium.ShadowMode.castShadows(picked.primitive.shadows); const receiveShadows = Cesium.ShadowMode.receiveShadows( - picked.primitive.shadows, + picked.primitive.shadows ); picked.primitive.shadows = Cesium.ShadowMode.fromCastReceive( castShadows, - !receiveShadows, + !receiveShadows ); } }, Cesium.ScreenSpaceEventType.MIDDLE_CLICK); diff --git a/Apps/Sandcastle/gallery/development/Simple Polyline.html b/Apps/Sandcastle/gallery/development/Simple Polyline.html index a4ae141bf4cc..25351d06139e 100644 --- a/Apps/Sandcastle/gallery/development/Simple Polyline.html +++ b/Apps/Sandcastle/gallery/development/Simple Polyline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -48,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 })); } @@ -87,7 +87,7 @@ lineWidth: Math.min(2.0, scene.maximumAliasedLineWidth), }, }), - }), + }) ); // Add perSegment and perVertex polyline instances to primitives. @@ -100,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 a9dbae875274..2624be3a936f 100644 --- a/Apps/Sandcastle/gallery/development/Sphere Outline.html +++ b/Apps/Sandcastle/gallery/development/Sphere Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,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 @@ -67,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 076128f89dd9..b2edb045c077 100644 --- a/Apps/Sandcastle/gallery/development/Sphere.html +++ b/Apps/Sandcastle/gallery/development/Sphere.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,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({ @@ -67,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 19d856167194..9e31f69ad5d6 100644 --- a/Apps/Sandcastle/gallery/development/Terrain Entity Batching.html +++ b/Apps/Sandcastle/gallery/development/Terrain Entity Batching.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -43,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 ), ]; @@ -129,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, @@ -152,7 +152,7 @@ -122.17778, 46.36169, -120.17778, - 48.36169, + 48.36169 ), material: checkerboard, classificationType: Cesium.ClassificationType.TERRAIN, @@ -164,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 0db156ec70cb..30e40177629e 100644 --- a/Apps/Sandcastle/gallery/development/Terrain Performance.html +++ b/Apps/Sandcastle/gallery/development/Terrain Performance.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -93,7 +93,7 @@ statistics.numberOfActiveRequestsEver } requests, min/max/avg frame FPS ${minFrameRate}/${maxFrameRate}/${ sumFrameRate / frameRateSamples - }`, + }` ); scene.postRender.removeEventListener(viewReady); } @@ -103,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; } @@ -127,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; } @@ -151,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; } @@ -175,7 +175,7 @@ const position = new Cesium.Cartesian3( 302955.90876054496, 5639614.4908250235, - 2981096.1048591887, + 2981096.1048591887 ); camera.flyTo({ destination: position, @@ -190,22 +190,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 ); const startCartographic = Cesium.Cartographic.fromCartesian(camera.position); diff --git a/Apps/Sandcastle/gallery/development/Terrain Tweaks.html b/Apps/Sandcastle/gallery/development/Terrain Tweaks.html index 4a75c4145fbf..faece8a528ed 100644 --- a/Apps/Sandcastle/gallery/development/Terrain Tweaks.html +++ b/Apps/Sandcastle/gallery/development/Terrain Tweaks.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -127,7 +127,7 @@ function updateFillHighlight() { if (viewModel.fillHighlightEnabled) { viewer.scene.globe.fillHighlightColor = Cesium.Color.fromCssColorString( - viewModel.fillHighlightColor, + viewModel.fillHighlightColor ); } else { viewer.scene.globe.fillHighlightColor = undefined; diff --git a/Apps/Sandcastle/gallery/development/Volumes.html b/Apps/Sandcastle/gallery/development/Volumes.html index 0f1e595670f0..9144be071381 100644 --- a/Apps/Sandcastle/gallery/development/Volumes.html +++ b/Apps/Sandcastle/gallery/development/Volumes.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -38,18 +38,18 @@ 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), - }), + }) ); 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 06d45ada4736..43130c3a4353 100644 --- a/Apps/Sandcastle/gallery/development/Wall Outline.html +++ b/Apps/Sandcastle/gallery/development/Wall Outline.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -41,7 +41,7 @@ }), attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor( - Cesium.Color.WHITE, + Cesium.Color.WHITE ), }, }); @@ -56,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 f693c615ebbd..1e3f209e5edf 100644 --- a/Apps/Sandcastle/gallery/development/Wall.html +++ b/Apps/Sandcastle/gallery/development/Wall.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -56,7 +56,16 @@ 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, @@ -71,11 +80,40 @@ // 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]; @@ -99,7 +137,7 @@ 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 6168860f97fa..9e921de37c05 100644 --- a/Apps/Sandcastle/gallery/glTF PBR Extensions.html +++ b/Apps/Sandcastle/gallery/glTF PBR Extensions.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -51,7 +51,7 @@ direction: new Cesium.Cartesian3( 0.2454278300540191, 0.8842635425193919, - 0.39729481195458805, + 0.39729481195458805 ), intensity: 0.0, }); @@ -70,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]; @@ -255,7 +255,7 @@ Cesium.Matrix4.multiplyByUniformScale( model.modelMatrix, scale, - model.modelMatrix, + model.modelMatrix ); radius *= scale; } @@ -264,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 c6745b6a770f..03f0dddfec2b 100644 --- a/Apps/Sandcastle/index.html +++ b/Apps/Sandcastle/index.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -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 7bdfff33f922..54e348a6c6ec 100644 --- a/Apps/Sandcastle/standalone.html +++ b/Apps/Sandcastle/standalone.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> @@ -71,7 +71,7 @@ document.head.appendChild(scriptElement); scriptElement.innerHTML = window.embedInSandcastleTemplate( code, - isFirefox, + isFirefox ); } </script> diff --git a/Apps/Sandcastle/templates/bucket-requirejs.html b/Apps/Sandcastle/templates/bucket-requirejs.html index 8abfa3142e4b..bde1e75919fc 100644 --- a/Apps/Sandcastle/templates/bucket-requirejs.html +++ b/Apps/Sandcastle/templates/bucket-requirejs.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/Sandcastle/templates/bucket.html b/Apps/Sandcastle/templates/bucket.html index eca73df143de..f03f1f56af4a 100644 --- a/Apps/Sandcastle/templates/bucket.html +++ b/Apps/Sandcastle/templates/bucket.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/Apps/TimelineDemo/TimelineDemo.js b/Apps/TimelineDemo/TimelineDemo.js index 4d30f2817db7..5f865c99146d 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) { `<br/>Start: ${timeline.makeLabel(e.startJulian)} UTC` + `<br/> Stop: ${timeline.makeLabel(e.endJulian)} UTC` + `<br/> Span: ${spanToString( - e.totalSpan, + e.totalSpan )}<br/>  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 b86bcb590e42..94e2a0143815 100644 --- a/Apps/TimelineDemo/index.html +++ b/Apps/TimelineDemo/index.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> diff --git a/CHANGES.md b/CHANGES.md index fc914d1a4267..01ab45bde1cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2155,7 +2155,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 921781f393c2..99ade2899769 100644 --- a/Documentation/Contributors/CodingGuide/README.md +++ b/Documentation/Contributors/CodingGuide/README.md @@ -181,6 +181,7 @@ Cartesian3.fromDegrees(); // Not Cartesin3.fromAngle() ```javascript "use strict"; + ``` - :speedboat: To avoid type coercion (implicit type conversion), test for equality with `===` and `!==`, e.g., @@ -368,7 +369,7 @@ function getTransform(node) { return Matrix4.fromTranslationQuaternionRotationScale( node.translation, node.rotation, - node.scale, + node.scale ); } } @@ -385,7 +386,7 @@ function getTransform(node) { return Matrix4.fromTranslationQuaternionRotationScale( node.translation, node.rotation, - node.scale, + node.scale ); } ``` @@ -443,7 +444,7 @@ Cartesian3.fromRadians = function (longitude, latitude, height) { ```javascript this._mapProjection = defaultValue( options.mapProjection, - new GeographicProjection(), + new GeographicProjection() ); ``` @@ -819,7 +820,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); } @@ -921,7 +922,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 e4ccab3e089c..adfc888ad445 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 915c8bf38d38..23a9c5131573 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 3ea2feaebf65..e50e84fa1cac 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 430c177ce7eb..b52d0e73cea8 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 b2fb32bcc5b0..d4f17e22c1e7 100644 --- a/Specs/Data/WMS/GetFeatureInfo.html +++ b/Specs/Data/WMS/GetFeatureInfo.html @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html> <head> <title>HTML yeah! diff --git a/Specs/DomEventSimulator.js b/Specs/DomEventSimulator.js index 8a6093ff6146..bbff151ae5c0 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 3cce276c929b..7513a4b497de 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,13 +127,14 @@ 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. @@ -150,33 +151,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. @@ -185,7 +186,7 @@ function makeBufferViews(subtreeDescription, subtreeJson) { bufferViewsU8, bufferViewJsonArray, parsedAvailability.other, - useLegacySchema, + useLegacySchema ); } if (bufferViewJsonArray.length > 0) { @@ -209,11 +210,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; @@ -235,7 +236,7 @@ function gatherBufferViews( bufferViewsU8, bufferViewJsonArray, parsedBitstream, - useLegacySchema, + useLegacySchema ) { if (defined(parsedBitstream.constant)) { parsedBitstream.availabilityJson = { @@ -339,7 +340,7 @@ function parseAvailability(availability) { const includeAvailableCount = availability.includeAvailableCount; const parsed = parseAvailabilityDescriptor( availability.descriptor, - includeAvailableCount, + includeAvailableCount ); parsed.isInternal = availability.isInternal; parsed.shareBuffer = availability.shareBuffer; @@ -398,10 +399,10 @@ function addMetadata( bufferViewsU8, subtreeJson, metadataOptions, - useLegacySchema, + useLegacySchema ) { const propertyTableResults = MetadataTester.createPropertyTables( - metadataOptions.propertyTables, + metadataOptions.propertyTables ); // Add bufferViews to the list ----------------------------------- @@ -444,7 +445,7 @@ function addMetadata( const tileProperties = getPropertiesObjectFromPropertyTable( tileTable, firstMetadataIndex, - useLegacySchema, + useLegacySchema ); const propertyTables = []; @@ -478,7 +479,7 @@ function addMetadata( const contentProperties = getPropertiesObjectFromPropertyTable( contentTable, firstMetadataIndex, - useLegacySchema, + useLegacySchema ); const contentMetadata = { class: contentTable.class, @@ -500,7 +501,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 09f8de4de4bb..119015be69d4 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 8d7b1b035464..e4116178c041 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 7adfe37b1cd9..9a482e38182f 100644 --- a/Specs/MockTerrainProvider.js +++ b/Specs/MockTerrainProvider.js @@ -12,12 +12,11 @@ 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(); @@ -33,10 +32,11 @@ 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,31 +80,34 @@ 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; }; @@ -112,10 +115,11 @@ 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; }; @@ -124,7 +128,7 @@ MockTerrainProvider.prototype.willHaveWaterMask = function ( includeWater, xOrTile, y, - level, + level ) { this._willHaveWaterMask[createTileKey(xOrTile, y, level)] = includeLand || includeWater @@ -139,7 +143,7 @@ MockTerrainProvider.prototype.willHaveWaterMask = function ( MockTerrainProvider.prototype.createMeshWillSucceed = function ( xOrTile, y, - level, + level ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = true; return this; @@ -148,7 +152,7 @@ MockTerrainProvider.prototype.createMeshWillSucceed = function ( MockTerrainProvider.prototype.createMeshWillFail = function ( xOrTile, y, - level, + level ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = false; return this; @@ -157,7 +161,7 @@ MockTerrainProvider.prototype.createMeshWillFail = function ( MockTerrainProvider.prototype.createMeshWillDefer = function ( xOrTile, y, - level, + level ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = undefined; return this; @@ -167,7 +171,7 @@ MockTerrainProvider.prototype.createMeshWillWaitOn = function ( promise, xOrTile, y, - level, + level ) { this._createMeshWillSucceed[createTileKey(xOrTile, y, level)] = promise; return this; @@ -176,7 +180,7 @@ MockTerrainProvider.prototype.createMeshWillWaitOn = function ( MockTerrainProvider.prototype.upsampleWillSucceed = function ( xOrTile, y, - level, + level ) { this._upsampleWillSucceed[createTileKey(xOrTile, y, level)] = true; return this; @@ -205,7 +209,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; @@ -253,7 +257,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 af6819864728..3f01f3b537f8 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 919b169b3940..6ff81e56d106 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 35e2aac381aa..7831cb00f5f9 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,17 +99,18 @@ 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 5f16001f287e..f79f22d0973c 100644 --- a/Specs/TestWorkers/transferArrayBuffer.js +++ b/Specs/TestWorkers/transferArrayBuffer.js @@ -1,9 +1,10 @@ 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/addDefaultMatchers.js b/Specs/addDefaultMatchers.js index 9ad56f65c30a..b35b1418e1e7 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 d665a8f96624..3ac362b5a2a2 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 20d0b1737bab..b7567a7e434c 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 a7838a72bdcf..8f4ba1c1f6b2 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 60df92fc25da..e91f6b743cc1 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 52fe5cb28f2c..bfd85501ee98 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 4d5fc9f41696..8d77067e94c2 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 b2678604b830..bd1ee9e98a14 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 a2cee81a68b5..619ec4c6f4a8 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 96a2834e80ce..c85af29111e9 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 c2b4766c600b..1a9da835b430 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 dde250550555..d2427793d9ce 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({ @@ -55,7 +55,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; @@ -63,14 +63,15 @@ 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, }, @@ -92,7 +93,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; @@ -100,14 +101,15 @@ 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 6fa0ade7b383..cf8a3db4d486 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 6a7e8d4d8a3e..6d355a5c229c 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 70163a76c391..e0f9aac10319 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 ca5e29874caa..0745c53a34f9 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 37feaf8375ad..0e6c3eead363 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 b08c0ce1dad9..45ba3a2e4af5 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 a29e68154f61..37d696d730fc 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 479d2ab6acbc..c9d4219ba917 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 403da932e31f..101e1d3bf314 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 d1f22148f43d..ecff98ccacbf 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 922207c35835..76d07505ed90 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,8 +62,7 @@ } 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 d96290826e09..37265871bd53 100644 --- a/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css +++ b/Tools/jsdoc/cesium_template/static/styles/jsdoc-default.css @@ -2,9 +2,7 @@ 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/eslint.config.js b/eslint.config.js index c8ec3d9bd70c..c8c2a6cc6f46 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,6 +19,7 @@ export default [ "packages/engine/Source/Shaders/**/*", "Specs/jasmine/*", "**/*/SpecList.js", + "temp_wasm/*", ], }, { diff --git a/gulpfile.js b/gulpfile.js index a8283e79b7fe..f987673cd835 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -373,6 +373,11 @@ export async function prepare() { "Tools/jsdoc/cesium_template/static/styles/prism.css", ); + copyFileSync( + "node_modules/cesiumjs-gsplat-utils/cesiumjs_gsplat_utils_bg.wasm", + "packages/engine/Source/ThirdParty/cesiumjs_gsplat_utils_bg.wasm", + ); + // Copy jasmine runner files into Specs const files = await globby([ "node_modules/jasmine-core/lib/jasmine-core", diff --git a/index.html b/index.html index 37c59ab3a7f4..7ffefd7ff360 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + Cesium diff --git a/index.release.html b/index.release.html index 0cf60e9f9de2..249062aaaa91 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/package.json b/package.json index 7be464bf072a..c9660cd8769f 100644 --- a/package.json +++ b/package.json @@ -52,10 +52,13 @@ ], "dependencies": { "@cesium/engine": "^11.1.0", - "@cesium/widgets": "^8.1.0" + "@cesium/widgets": "^8.1.0", + "cesiumjs-gsplat-utils": "file:./temp_wasm/cesiumjs-gsplat-utils/pkg", + "esbuild-plugin-wasm": "^1.1.0" }, "devDependencies": { "@playwright/test": "^1.41.1", + "assemblyscript": "^0.27.30", "chokidar": "^4.0.1", "cloc": "^2.2.0-cloc", "compression": "^1.7.4", @@ -158,4 +161,4 @@ "packages/engine", "packages/widgets" ] -} \ No newline at end of file +} diff --git a/packages/engine/Source/Core/ApproximateTerrainHeights.js b/packages/engine/Source/Core/ApproximateTerrainHeights.js index c8dc1230cdc3..35d982aa667d 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 41154ff6aa04..bc796406b8c0 100644 --- a/packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js +++ b/packages/engine/Source/Core/ArcGISTiledElevationTerrainProvider.js @@ -73,8 +73,7 @@ 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; }; @@ -95,10 +94,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 @@ -119,14 +118,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"); @@ -150,31 +149,30 @@ 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." ); } @@ -194,7 +192,7 @@ function parseMetadataSuccess(terrainProviderBuilder, metadata) { async function requestMetadata( terrainProviderBuilder, metadataResource, - provider, + provider ) { try { const metadata = await metadataResource.fetchJson(); @@ -205,7 +203,7 @@ async function requestMetadata( undefined, provider, defined(provider) ? provider._errorEvent : undefined, - message, + message ); throw error; @@ -402,7 +400,7 @@ ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request, + request ) { const tileResource = this._resource.getDerivedResource({ url: `tile/${level}/${y}/${x}`, @@ -421,7 +419,7 @@ ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function ( this, level + 1, x * 2, - y * 2, + y * 2 ); availabilityPromise = availabilityResult.promise; @@ -501,10 +499,11 @@ 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. @@ -517,7 +516,7 @@ ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level, + level ) { if (!this._hasAvailability) { return undefined; @@ -541,10 +540,13 @@ 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; @@ -708,7 +710,7 @@ function requestAvailability(that, level, x, y) { yOffset, dim, dim, - result.data, + result.data ); // Mark whole area as having availability loaded @@ -717,7 +719,7 @@ function requestAvailability(that, level, x, y) { xOffset, yOffset, xOffset + dim, - yOffset + dim, + yOffset + dim ); const tilesAvailable = that._tilesAvailable; @@ -728,7 +730,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 aa390cbcdb70..b6b521cc0097 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 d5ddea4992a3..41af002cd3c8 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 647658fcd2d3..a9292e57015d 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 ae678725057a..220164a84168 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 e43530a8f8a9..9ee58a40d09d 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 d6b4e6bc321a..405107e0afd5 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 1933cdad1a40..5e18ee05e9b1 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 6993889d5a8b..9d7d8137359c 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 c4415d6bace4..685587b8fffd 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 a2bffc45b705..fa841cc9b2aa 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 091d80895ca8..3f0317b6f679 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 b2181f642e67..8f7c4ea6d9f2 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 64497322ab0b..9ce3f464f3b3 100644 --- a/packages/engine/Source/Core/CesiumTerrainProvider.js +++ b/packages/engine/Source/Core/CesiumTerrainProvider.js @@ -104,8 +104,7 @@ 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; @@ -121,7 +120,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message, + message ); throw new RuntimeError(message); @@ -134,7 +133,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message, + message ); throw new RuntimeError(message); @@ -167,7 +166,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message, + message ); throw new RuntimeError(message); @@ -178,7 +177,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 @@ -200,18 +199,17 @@ 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 { @@ -220,7 +218,7 @@ async function parseMetadataSuccess(terrainProviderBuilder, data, provider) { terrainProviderBuilder.previousError, provider, defined(provider) ? provider._errorEvent : undefined, - message, + message ); throw new RuntimeError(message); @@ -259,12 +257,13 @@ 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] = []; } @@ -288,18 +287,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); @@ -332,27 +331,29 @@ 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; } @@ -370,7 +371,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. @@ -386,11 +387,10 @@ 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,15 +757,16 @@ 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; @@ -780,14 +781,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 ); } } @@ -810,7 +811,7 @@ function createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) { rectangle, minimumHeight, maximumHeight, - provider._tilingScheme.ellipsoid, + provider._tilingScheme.ellipsoid ); return new QuantizedMeshTerrainData({ @@ -855,7 +856,7 @@ CesiumTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request, + request ) { const layers = this._layers; let layerToUse; @@ -883,13 +884,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 ); } } @@ -936,7 +937,7 @@ function requestTileGeometry(provider, x, y, level, layerToUse, request) { extensionList.push( layerToUse.littleEndianExtensionSize ? "octvertexnormals" - : "vertexnormals", + : "vertexnormals" ); } if (provider._requestWaterMask && layerToUse.hasWaterMask) { @@ -997,7 +998,7 @@ function requestTileGeometry(provider, x, y, level, layerToUse, request) { level, x, y, - layerToUse, + layerToUse ); }); } @@ -1149,7 +1150,7 @@ Object.defineProperties(CesiumTerrainProvider.prototype, { * @returns {number} The maximum geometric error. */ CesiumTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level, + level ) { return this._levelZeroMaximumGeometricError / (1 << level); }; @@ -1237,10 +1238,11 @@ 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); @@ -1299,7 +1301,7 @@ CesiumTerrainProvider.prototype.getTileDataAvailable = function (x, y, level) { CesiumTerrainProvider.prototype.loadTileDataAvailability = function ( x, y, - level, + level ) { if ( !defined(this._availability) || @@ -1381,7 +1383,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.js b/packages/engine/Source/Core/Check.js index 7fced35d2b39..83f0c9ab0b11 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 0f4b0c2bf1e8..c713363cbe71 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 98662f200a21..f7b29d09151c 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 272b9dc78915..8bdea4fbf34c 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 ab6860c00d25..23683732133b 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,14 +350,11 @@ 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. @@ -428,7 +425,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 87992d602b2f..1b409b4255b3 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 4e6a3892148a..9e92afe2696b 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 f9f3fe7d76d6..0974f06d5305 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 858330ec09ac..032003de3a3f 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 8d2c7def35cb..eba53cf61bd7 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,13 +473,12 @@ 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; } @@ -491,12 +490,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); @@ -504,18 +503,16 @@ 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); @@ -528,7 +525,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { polygonHierarchy, hasTextureCoordinates, projectPoints, - false, + false ); const hierarchy = results.hierarchy; const polygons = results.polygons; @@ -542,7 +539,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { textureCoordinates, true, dummyFunction, - false, + false ).polygons : undefined; @@ -557,7 +554,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { projectPoint, outerPositions, stRotation, - scratchBR, + scratchBR ); const geometries = []; @@ -572,7 +569,7 @@ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) { projectPoint, normal, tangent, - bitangent, + bitangent ), }); @@ -581,11 +578,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 7445eb60a38a..8137fc757af9 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 011799c84f8d..0f9009676708 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 0b5ead6bfcc0..4e80a59f09e5 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 42bbc3031485..f564f6b85513 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 5718f107d2f0..b786b07f6bc1 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 67b7724c27f0..080d4a0a7688 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 eeefc818e31a..0df50356e674 100644 --- a/packages/engine/Source/Core/CustomHeightmapTerrainProvider.js +++ b/packages/engine/Source/Core/CustomHeightmapTerrainProvider.js @@ -75,12 +75,11 @@ 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(); @@ -217,7 +216,7 @@ CustomHeightmapTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request, + request ) { const promise = this._callback(x, y, level); if (!defined(promise)) { @@ -248,10 +247,11 @@ 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 = 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 2733c91d36a2..a2b620c57a72 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 f29beccd698f..c6784a518572 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 45e7e57fa094..bd587dcb4084 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 9094cdc3e5a8..a330471eef23 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 d999a65cfdff..6bf81bd70db0 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,24 +127,25 @@ 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'); - - return new DistanceDisplayConditionGeometryInstanceAttribute( - distanceDisplayCondition.near, - distanceDisplayCondition.far, +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 + ); +}; /** * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute. @@ -159,7 +160,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 d87eb287c582..e0abcf5f6e0f 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 76a34e141422..514d9284a584 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,31 +241,35 @@ 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", + "yCelestialPoleOffsetRadians" + ); + const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf( + "taiMinusUtcSeconds" ); - const taiMinusUtcSecondsColumn = - eopData.columnNames.indexOf("taiMinusUtcSeconds"); if ( dateColumn < 0 || @@ -277,7 +281,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" ); } @@ -315,7 +319,7 @@ function onDataReady(eop, eopData) { const leapSecondIndex = binarySearch( leapSeconds, date, - compareLeapSecondDates, + compareLeapSecondDates ); if (leapSecondIndex < 0) { const leapSecond = new LeapSecond(date, taiMinusUtc); @@ -403,27 +407,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 9ff066aa6c0f..336e564da4b8 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 1815080ded86..0a225fdca1fc 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,8 +1314,9 @@ 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 25030fb725a9..acf09c2a2f33 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 346bbc3e71bd..0fc77099dba2 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 def0d0862dee..b76f3f3a04a0 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,17 +775,25 @@ 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, ]; /** @@ -871,7 +879,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 ef15944b1c25..b15475b93bce 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,21 +234,20 @@ 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'); @@ -259,12 +258,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; @@ -410,11 +409,11 @@ EllipsoidGeodesic.prototype.setEndPoints = function (start, end) { */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function ( fraction, - result, + result ) { return this.interpolateUsingSurfaceDistance( this._distance * fraction, - result, + result ); }; @@ -429,7 +428,7 @@ EllipsoidGeodesic.prototype.interpolateUsingFraction = function ( */ EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function ( distance, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.defined("distance", this._distance); @@ -497,7 +496,7 @@ EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function ( const lambda = Math.atan2( sineSigma * constants.sineHeading, - cc - ss * constants.cosineHeading, + cc - ss * constants.cosineHeading ); const l = @@ -509,7 +508,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 3912ad9c4d10..e6a8409dc78b 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,14 +275,13 @@ 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); @@ -642,7 +641,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 0fbd1edd2434..53b1fd403a97 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 834b8a857b74..9c61eed0a00c 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,21 +249,20 @@ 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'); @@ -274,12 +273,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; @@ -291,7 +290,7 @@ function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) { start.longitude, start.latitude, end.longitude, - end.latitude, + end.latitude ); ellipsoidRhumbLine._distance = calculateArcLength( ellipsoidRhumbLine, @@ -300,7 +299,7 @@ function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) { start.longitude, start.latitude, end.longitude, - end.latitude, + end.latitude ); } @@ -310,7 +309,7 @@ function interpolateUsingSurfaceDistance( distance, major, ellipticity, - result, + result ) { if (distance === 0.0) { return Cartographic.clone(start, result); @@ -491,7 +490,7 @@ EllipsoidRhumbLine.fromStartHeadingDistance = function ( heading, distance, ellipsoid, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.defined("start", start); @@ -513,7 +512,7 @@ EllipsoidRhumbLine.fromStartHeadingDistance = function ( heading, distance, e.maximumRadius, - ellipticity, + ellipticity ); if ( @@ -551,11 +550,11 @@ EllipsoidRhumbLine.prototype.setEndPoints = function (start, end) { */ EllipsoidRhumbLine.prototype.interpolateUsingFraction = function ( fraction, - result, + result ) { return this.interpolateUsingSurfaceDistance( fraction * this._distance, - result, + result ); }; @@ -570,13 +569,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'); @@ -587,7 +586,7 @@ EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function ( distance, this._ellipsoid.maximumRadius, this._ellipticity, - result, + result ); }; @@ -603,13 +602,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'); @@ -625,7 +624,7 @@ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function ( CesiumMath.equalsEpsilon( Math.abs(intersectionLongitude), Math.PI, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ) ) { intersectionLongitude = CesiumMath.sign(start.longitude) * Math.PI; @@ -646,14 +645,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; @@ -684,7 +683,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)); @@ -707,13 +706,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'); @@ -727,7 +726,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 c7b73ca4888f..f351b97537b1 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 ad08037ccf4b..00ae7885588d 100644 --- a/packages/engine/Source/Core/EllipsoidTerrainProvider.js +++ b/packages/engine/Source/Core/EllipsoidTerrainProvider.js @@ -35,12 +35,11 @@ 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(); } @@ -142,7 +141,7 @@ EllipsoidTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request, + request ) { const width = 16; const height = 16; @@ -151,7 +150,7 @@ EllipsoidTerrainProvider.prototype.requestTileGeometry = function ( buffer: new Uint8Array(width * height), width: width, height: height, - }), + }) ); }; @@ -162,7 +161,7 @@ EllipsoidTerrainProvider.prototype.requestTileGeometry = function ( * @returns {number} The maximum geometric error. */ EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level, + level ) { return this._levelZeroMaximumGeometricError / (1 << level); }; @@ -178,7 +177,7 @@ EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function ( EllipsoidTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level, + level ) { return undefined; }; @@ -194,7 +193,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 6f8fee3143f9..e94d8bbcbf3d 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,34 +147,36 @@ 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; - return isScaledSpacePointVisible( - occludeeScaledSpacePosition, - cv, - vhMagnitudeSquared, - ); - }; + 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 + ); +}; /** * Computes a point that can be used for horizon culling from a list of positions. If the point is below @@ -195,13 +197,13 @@ EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = EllipsoidalOccluder.prototype.computeHorizonCullingPoint = function ( directionToPoint, positions, - result, + result ) { return computeHorizonCullingPointFromPositions( this._ellipsoid, directionToPoint, positions, - result, + result ); }; @@ -224,20 +226,24 @@ 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 @@ -256,17 +262,22 @@ 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 @@ -287,22 +298,28 @@ EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = * @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 = []; @@ -318,28 +335,31 @@ 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'); - // 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; - } + 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; + } - return this.computeHorizonCullingPoint(bs.center, positions, result); - }; + return this.computeHorizonCullingPoint(bs.center, positions, result); +}; const scratchEllipsoidShrunkRadii = new Cartesian3(); @@ -353,7 +373,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); } @@ -364,7 +384,7 @@ function computeHorizonCullingPointFromPositions( ellipsoid, directionToPoint, positions, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("directionToPoint", directionToPoint); @@ -377,7 +397,7 @@ function computeHorizonCullingPointFromPositions( const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint( ellipsoid, - directionToPoint, + directionToPoint ); let resultMagnitude = 0.0; @@ -386,7 +406,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 @@ -406,7 +426,7 @@ function computeHorizonCullingPointFromVertices( vertices, stride, center, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("directionToPoint", directionToPoint); @@ -422,7 +442,7 @@ function computeHorizonCullingPointFromVertices( center = defaultValue(center, Cartesian3.ZERO); const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint( ellipsoid, - directionToPoint, + directionToPoint ); let resultMagnitude = 0.0; @@ -434,7 +454,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 @@ -449,7 +469,7 @@ function computeHorizonCullingPointFromVertices( function isScaledSpacePointVisible( occludeeScaledSpacePosition, cameraPositionInScaledSpace, - distanceToLimbInScaledSpaceSquared, + distanceToLimbInScaledSpaceSquared ) { // See https://cesium.com/blog/2013/04/25/Horizon-culling/ const cv = cameraPositionInScaledSpace; @@ -457,7 +477,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 @@ -477,14 +497,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. @@ -493,7 +513,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; @@ -504,7 +524,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. @@ -519,7 +539,7 @@ function magnitudeToPoint( return Cartesian3.multiplyByScalar( scaledSpaceDirectionToPoint, resultMagnitude, - result, + result ); } @@ -532,7 +552,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 425b247ecb95..795f79e34e4b 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 ab6896739f8e..46fcb8cfb785 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 f77783980bd0..e49aea1bd141 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 f23d5d4c98ab..ca2449b6b015 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 6c134fd02d6d..bbde3c60b1d0 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 9f4d442c0a7a..91713c415120 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 18ad60900919..da62fe0f302f 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 d00730c92778..240ced324bd4 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 7b7dd96b12d4..9bb1a5c79086 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,8 +1567,9 @@ 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; @@ -1581,27 +1582,30 @@ 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); } } } @@ -1640,14 +1644,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; @@ -1668,7 +1672,7 @@ function indexTriangleFan(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - (numberOfVertices - 2) * 3, + (numberOfVertices - 2) * 3 ); indices[0] = 1; indices[1] = 0; @@ -1697,7 +1701,7 @@ function indexTriangleStrip(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - (numberOfVertices - 2) * 3, + (numberOfVertices - 2) * 3 ); indices[0] = 0; indices[1] = 1; @@ -1744,7 +1748,7 @@ function indexLines(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - numberOfVertices, + numberOfVertices ); for (let i = 0; i < numberOfVertices; ++i) { indices[i] = i; @@ -1765,7 +1769,7 @@ function indexLineStrip(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - (numberOfVertices - 1) * 2, + (numberOfVertices - 1) * 2 ); indices[0] = 0; indices[1] = 1; @@ -1791,7 +1795,7 @@ function indexLineLoop(geometry) { const indices = IndexDatatype.createTypedArray( numberOfVertices, - numberOfVertices * 2, + numberOfVertices * 2 ); indices[0] = 0; @@ -1878,9 +1882,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); @@ -2017,7 +2021,7 @@ function updateGeometryAfterSplit(geometry, computeBoundingSphere) { const attribute = attributes[property]; attribute.values = ComponentDatatype.createTypedArray( attribute.componentDatatype, - attribute.values, + attribute.values ); } } @@ -2025,12 +2029,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 ); } @@ -2083,7 +2087,7 @@ function updateInstanceAfterSplit(instance, westGeometry, eastGeometry) { function generateBarycentricInterpolateFunction( CartesianType, - numberOfComponents, + numberOfComponents ) { const v0Scratch = new CartesianType(); const v1Scratch = new CartesianType(); @@ -2097,22 +2101,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); @@ -2129,22 +2133,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, @@ -2153,7 +2157,7 @@ const interpolateAndPackBoolean = function ( coords, sourceValues, currentValues, - insertedIndex, + insertedIndex ) { const v1 = sourceValues[i0] * coords.x; const v2 = sourceValues[i1] * coords.y; @@ -2182,7 +2186,7 @@ function computeTriangleAttributes( customAttributeNames, customAttributesLength, allAttributes, - insertedIndex, + insertedIndex ) { if ( !defined(normals) && @@ -2212,7 +2216,7 @@ function computeTriangleAttributes( normals, currentAttributes.normal.values, insertedIndex, - true, + true ); } @@ -2243,7 +2247,7 @@ function computeTriangleAttributes( Cartesian3.pack( direction, currentAttributes.extrudeDirection.values, - insertedIndex * 3, + insertedIndex * 3 ); } @@ -2255,7 +2259,7 @@ function computeTriangleAttributes( coords, applyOffset, currentAttributes.applyOffset.values, - insertedIndex, + insertedIndex ); } @@ -2268,7 +2272,7 @@ function computeTriangleAttributes( tangents, currentAttributes.tangent.values, insertedIndex, - true, + true ); } @@ -2281,7 +2285,7 @@ function computeTriangleAttributes( bitangents, currentAttributes.bitangent.values, insertedIndex, - true, + true ); } @@ -2293,7 +2297,7 @@ function computeTriangleAttributes( coords, texCoords, currentAttributes.st.values, - insertedIndex, + insertedIndex ); } @@ -2307,7 +2311,7 @@ function computeTriangleAttributes( coords, insertedIndex, allAttributes[attributeName], - currentAttributes[attributeName], + currentAttributes[attributeName] ); } } @@ -2320,7 +2324,7 @@ function genericInterpolate( coords, insertedIndex, sourceAttribute, - currentAttribute, + currentAttribute ) { const componentsPerAttribute = sourceAttribute.componentsPerAttribute; const sourceValues = sourceAttribute.values; @@ -2335,7 +2339,7 @@ function genericInterpolate( sourceValues, currentValues, insertedIndex, - false, + false ); break; case 3: @@ -2347,7 +2351,7 @@ function genericInterpolate( sourceValues, currentValues, insertedIndex, - false, + false ); break; case 2: @@ -2359,7 +2363,7 @@ function genericInterpolate( sourceValues, currentValues, insertedIndex, - false, + false ); break; default: @@ -2376,7 +2380,7 @@ function insertSplitPoint( currentIndexMap, indices, currentIndex, - point, + point ) { const insertIndex = currentAttributes.position.values.length / 3; @@ -2499,7 +2503,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, - point, + point ); computeTriangleAttributes( i0, @@ -2517,7 +2521,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex, + insertedIndex ); } } else { @@ -2543,7 +2547,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, i, - p0, + p0 ); computeTriangleAttributes( i0, @@ -2561,7 +2565,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex, + insertedIndex ); insertedIndex = insertSplitPoint( @@ -2570,7 +2574,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, i + 1, - p1, + p1 ); computeTriangleAttributes( i0, @@ -2588,7 +2592,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex, + insertedIndex ); insertedIndex = insertSplitPoint( @@ -2597,7 +2601,7 @@ function splitLongitudeTriangles(instance) { currentIndexMap, indices, i + 2, - p2, + p2 ); computeTriangleAttributes( i0, @@ -2615,7 +2619,7 @@ function splitLongitudeTriangles(instance) { customAttributeNames, customAttributesLength, attributes, - insertedIndex, + insertedIndex ); } } @@ -2635,7 +2639,7 @@ function computeLineAttributes( positions, insertIndex, currentAttributes, - applyOffset, + applyOffset ) { if (!defined(applyOffset)) { return; @@ -2710,14 +2714,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); @@ -2733,7 +2737,7 @@ function splitLongitudeLines(instance) { const offsetPoint = Cartesian3.add( intersection, offset, - offsetPointScratch, + offsetPointScratch ); insertIndex = insertSplitPoint( @@ -2742,7 +2746,7 @@ function splitLongitudeLines(instance) { p0IndexMap, indices, i, - p0, + p0 ); computeLineAttributes( i0, @@ -2751,7 +2755,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p0Attributes, - applyOffset, + applyOffset ); insertIndex = insertSplitPoint( @@ -2760,7 +2764,7 @@ function splitLongitudeLines(instance) { p0IndexMap, indices, -1, - offsetPoint, + offsetPoint ); computeLineAttributes( i0, @@ -2769,7 +2773,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p0Attributes, - applyOffset, + applyOffset ); Cartesian3.negate(offset, offset); @@ -2780,7 +2784,7 @@ function splitLongitudeLines(instance) { p1IndexMap, indices, -1, - offsetPoint, + offsetPoint ); computeLineAttributes( i0, @@ -2789,7 +2793,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p1Attributes, - applyOffset, + applyOffset ); insertIndex = insertSplitPoint( @@ -2798,7 +2802,7 @@ function splitLongitudeLines(instance) { p1IndexMap, indices, i + 1, - p1, + p1 ); computeLineAttributes( i0, @@ -2807,7 +2811,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, p1Attributes, - applyOffset, + applyOffset ); } else { let currentAttributes; @@ -2830,7 +2834,7 @@ function splitLongitudeLines(instance) { currentIndexMap, indices, i, - p0, + p0 ); computeLineAttributes( i0, @@ -2839,7 +2843,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, currentAttributes, - applyOffset, + applyOffset ); insertIndex = insertSplitPoint( @@ -2848,7 +2852,7 @@ function splitLongitudeLines(instance) { currentIndexMap, indices, i + 1, - p1, + p1 ); computeLineAttributes( i0, @@ -2857,7 +2861,7 @@ function splitLongitudeLines(instance) { positions, insertIndex, currentAttributes, - applyOffset, + applyOffset ); } } @@ -2893,7 +2897,7 @@ function updateAdjacencyAfterSplit(geometry) { const prevPosition = Cartesian3.unpack( prevPositions, j, - cartesian3Scratch2, + cartesian3Scratch2 ); if ( (position.y < 0.0 && prevPosition.y > 0.0) || @@ -2911,7 +2915,7 @@ function updateAdjacencyAfterSplit(geometry) { const nextPosition = Cartesian3.unpack( nextPositions, j, - cartesian3Scratch3, + cartesian3Scratch3 ); if ( (position.y < 0.0 && nextPosition.y > 0.0) || @@ -2998,7 +3002,7 @@ function splitLongitudePolyline(instance) { p0, p2, xzPlane, - cartesian3Scratch4, + cartesian3Scratch4 ); if (defined(intersection)) { intersectionFound = true; @@ -3007,7 +3011,7 @@ function splitLongitudePolyline(instance) { const offset = Cartesian3.multiplyByScalar( Cartesian3.UNIT_Y, offsetScalar, - cartesian3Scratch5, + cartesian3Scratch5 ); if (p0.y < 0.0) { Cartesian3.negate(offset, offset); @@ -3020,51 +3024,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); @@ -3072,52 +3076,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); @@ -3127,10 +3131,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)) { @@ -3159,7 +3163,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 bc485be490aa..50dc850c7e2c 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,10 +483,11 @@ 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({ @@ -524,7 +525,7 @@ function requestDbRoot(that) { }) .then(function (buf) { const encryptedDbRootProto = dbrootParser.EncryptedDbRootProto.decode( - new Uint8Array(buf), + new Uint8Array(buf) ); let byteArray = encryptedDbRootProto.encryptionData; @@ -542,37 +543,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 e3c4b68bf208..f343aff99575 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,10 +425,9 @@ 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(); @@ -449,17 +448,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( @@ -471,7 +470,7 @@ function interpolateMeshHeight(terrainData, u, v) { uv1.y, uv2.x, uv2.y, - barycentricCoordinateScratch, + barycentricCoordinateScratch ); if ( barycentric.x >= -1e-15 && @@ -587,7 +586,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 d13e05ac1d71..05e348e000ff 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,10 +486,11 @@ 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. @@ -502,7 +503,7 @@ GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level, + level ) { const metadata = this._metadata; let quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level); @@ -556,10 +557,13 @@ 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 72eeb54b2953..e1caecb56ae5 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 7ec935068796..15d1a1251cc0 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 c5291ca31ab1..4fb7446d61db 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 56f207eb9c6f..2d3a1375346a 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,22 +242,21 @@ 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); @@ -278,7 +277,7 @@ function getPosition(ellipsoid, cartographic, height, result) { return Cartographic.toCartesian( heightlessCartographicScratch, ellipsoid, - result, + result ); } @@ -398,7 +397,7 @@ function computeVertexMiterNormal( vertexBottom, vertexTop, nextBottom, - result, + result ) { const up = direction(vertexTop, vertexBottom, vertexUpScratch); @@ -407,7 +406,7 @@ function computeVertexMiterNormal( previousBottom, vertexBottom, up, - toPreviousScratch, + toPreviousScratch ); const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch); @@ -416,7 +415,7 @@ function computeVertexMiterNormal( CesiumMath.equalsEpsilon( Cartesian3.dot(toPrevious, toNext), cosine180, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ) ) { result = Cartesian3.cross(up, toPrevious, result); @@ -463,7 +462,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; @@ -498,7 +497,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { p0, p1, XZ_PLANE, - intersectionScratch, + intersectionScratch ); if ( defined(intersection) && @@ -510,18 +509,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) && @@ -542,7 +541,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { p0, p1, XZ_PLANE, - intersectionScratch, + intersectionScratch ); if ( defined(intersection) && @@ -554,18 +553,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) && @@ -583,7 +582,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; @@ -591,7 +590,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { cartographics = arrayRemoveDuplicates( cartographics, - Cartographic.equalsEpsilon, + Cartographic.equalsEpsilon ); cartographicsLength = cartographics.length; @@ -624,14 +623,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); @@ -641,7 +640,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { vertexBottom, vertexTop, nextBottom, - vertexNormal, + vertexNormal ); } else { vertexNormal = computeRightNormal( @@ -649,7 +648,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { nextCartographic, maxHeight, ellipsoid, - vertexNormal, + vertexNormal ); } @@ -670,7 +669,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray, + cartographicsArray ); // All inbetween points @@ -686,7 +685,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { vertexBottom, vertexTop, nextBottom, - vertexNormal, + vertexNormal ); index = normalsArray.length; @@ -707,7 +706,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray, + cartographicsArray ); } @@ -719,7 +718,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { ellipsoid, endCartographic, minHeight, - vertexBottom, + vertexBottom ); vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop); @@ -729,13 +728,13 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { ellipsoid, preEndCartographic, minHeight, - previousBottom, + previousBottom ); nextBottom = getPosition( ellipsoid, postEndCartographic, minHeight, - nextBottom, + nextBottom ); vertexNormal = computeVertexMiterNormal( @@ -743,7 +742,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { vertexBottom, vertexTop, nextBottom, - vertexNormal, + vertexNormal ); } else { vertexNormal = computeRightNormal( @@ -751,7 +750,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { endCartographic, maxHeight, ellipsoid, - vertexNormal, + vertexNormal ); } @@ -774,7 +773,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { normalsArray, bottomPositionsArray, topPositionsArray, - cartographicsArray, + cartographicsArray ); index = normalsArray.length; for (i = 0; i < 3; ++i) { @@ -793,7 +792,7 @@ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) { topPositionsArray, normalsArray, cartographicsArray, - compute2dAttributes, + compute2dAttributes ); }; @@ -816,13 +815,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; } @@ -837,12 +836,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; @@ -850,7 +849,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 @@ -864,23 +863,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); @@ -898,13 +897,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); @@ -912,7 +911,7 @@ function adjustHeights( let adjustHeightOffset = Cartesian3.multiplyByScalar( adjustHeightNormal, distanceForBottom, - adjustHeightOffsetScratch, + adjustHeightOffsetScratch ); Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom); @@ -920,7 +919,7 @@ function adjustHeights( adjustHeightOffset = Cartesian3.multiplyByScalar( adjustHeightNormal, distanceForTop, - adjustHeightOffsetScratch, + adjustHeightOffsetScratch ); Cartesian3.add(top, adjustHeightOffset, adjustHeightTop); } @@ -1060,7 +1059,7 @@ function generateGeometryAttributes( topPositionsArray, normalsArray, cartographicsArray, - compute2dAttributes, + compute2dAttributes ) { let i; let index; @@ -1082,10 +1081,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; @@ -1124,15 +1123,15 @@ function generateGeometryAttributes( segmentStartCartesian = projection.project( startCartographic, - segmentStartCartesian, + segmentStartCartesian ); segmentEndCartesian = projection.project( endCartographic, - segmentEndCartesian, + segmentEndCartesian ); length2D += Cartesian3.distance( segmentStartCartesian, - segmentEndCartesian, + segmentEndCartesian ); index += 2; } @@ -1143,7 +1142,7 @@ function generateGeometryAttributes( segmentEndCartesian = Cartesian3.unpack( topPositionsArray, 0, - segmentEndCartesian, + segmentEndCartesian ); let length3D = 0.0; @@ -1151,12 +1150,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; @@ -1174,26 +1173,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 ); } } @@ -1209,26 +1208,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); @@ -1264,14 +1263,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 @@ -1280,13 +1279,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 { @@ -1296,13 +1295,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; } @@ -1322,12 +1321,12 @@ function generateGeometryAttributes( const encodedStart = EncodedCartesian3.fromCartesian( startBottom, - encodeScratch, + encodeScratch ); const forwardOffset = Cartesian3.subtract( endBottom, startBottom, - offsetScratch, + offsetScratch ); const forward = Cartesian3.normalize(forwardOffset, rightScratch); @@ -1339,7 +1338,7 @@ function generateGeometryAttributes( let startPlaneNormal = Cartesian3.cross( startUp, startGeometryNormal, - startPlaneNormalScratch, + startPlaneNormalScratch ); startPlaneNormal = Cartesian3.normalize(startPlaneNormal, startPlaneNormal); @@ -1348,7 +1347,7 @@ function generateGeometryAttributes( let endPlaneNormal = Cartesian3.cross( endGeometryNormal, endUp, - endPlaneNormalScratch, + endPlaneNormalScratch ); endPlaneNormal = Cartesian3.normalize(endPlaneNormal, endPlaneNormal); @@ -1367,12 +1366,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 @@ -1407,14 +1406,14 @@ function generateGeometryAttributes( Cartesian3.pack( startPlaneNormal, startNormalAndForwardOffsetZ, - vec4Index, + vec4Index ); startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z; Cartesian3.pack( endPlaneNormal, endNormalAndTextureCoordinateNormalizationX, - vec4Index, + vec4Index ); endNormalAndTextureCoordinateNormalizationX[wIndex] = texcoordNormalization3DX * rightPlaneSide; @@ -1422,15 +1421,16 @@ 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 2fe724cc998b..92a3dadfefc2 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 1b8b47d3be61..fab32e682b89 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,12 +237,11 @@ 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); @@ -276,15 +275,14 @@ 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 ); } @@ -308,7 +306,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. @@ -343,7 +341,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; @@ -355,12 +353,11 @@ 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); @@ -385,15 +382,14 @@ 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 ); } @@ -417,7 +413,7 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { indicesAndEdges.westIndicesSouthToNorth, indicesAndEdges.southIndicesEastToWest, indicesAndEdges.eastIndicesNorthToSouth, - indicesAndEdges.northIndicesWestToEast, + indicesAndEdges.northIndicesWestToEast ); return this._mesh; @@ -436,7 +432,7 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) { HeightmapTerrainData.prototype.interpolateHeight = function ( rectangle, longitude, - latitude, + latitude ) { const width = this._width; const height = this._height; @@ -472,7 +468,7 @@ HeightmapTerrainData.prototype.interpolateHeight = function ( width, height, longitude, - latitude, + latitude ); } else { heightSample = interpolateHeight( @@ -485,7 +481,7 @@ HeightmapTerrainData.prototype.interpolateHeight = function ( width, height, longitude, - latitude, + latitude ); heightSample = heightSample * heightScale + heightOffset; } @@ -514,7 +510,7 @@ HeightmapTerrainData.prototype.upsample = function ( thisLevel, descendantX, descendantY, - descendantLevel, + descendantLevel ) { //>>includeStart('debug', pragmas.debug); if (!defined(tilingScheme)) { @@ -541,7 +537,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'); @@ -565,12 +561,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; @@ -586,13 +582,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, @@ -603,7 +599,7 @@ HeightmapTerrainData.prototype.upsample = function ( width, height, longitude, - latitude, + latitude ); // Use conditionals here instead of Math.min and Math.max so that an undefined @@ -625,7 +621,7 @@ HeightmapTerrainData.prototype.upsample = function ( stride, isBigEndian, j * width + i, - heightSample, + heightSample ); } } @@ -638,7 +634,7 @@ HeightmapTerrainData.prototype.upsample = function ( childTileMask: 0, structure: this._structure, createdByUpsampling: true, - }), + }) ); }; @@ -658,7 +654,7 @@ HeightmapTerrainData.prototype.isChildAvailable = function ( thisX, thisY, childX, - childY, + childY ) { //>>includeStart('debug', pragmas.debug); if (!defined(thisX)) { @@ -708,7 +704,7 @@ function interpolateHeight( width, height, longitude, - latitude, + latitude ) { const fromWest = ((longitude - sourceRectangle.west) * (width - 1)) / @@ -743,7 +739,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - southInteger * width + westInteger, + southInteger * width + westInteger ); const southeastHeight = getHeight( sourceHeights, @@ -751,7 +747,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - southInteger * width + eastInteger, + southInteger * width + eastInteger ); const northwestHeight = getHeight( sourceHeights, @@ -759,7 +755,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - northInteger * width + westInteger, + northInteger * width + westInteger ); const northeastHeight = getHeight( sourceHeights, @@ -767,7 +763,7 @@ function interpolateHeight( elementMultiplier, stride, isBigEndian, - northInteger * width + eastInteger, + northInteger * width + eastInteger ); return triangleInterpolateHeight( @@ -776,7 +772,7 @@ function interpolateHeight( southwestHeight, southeastHeight, northwestHeight, - northeastHeight, + northeastHeight ); } @@ -789,7 +785,7 @@ function interpolateMeshHeight( width, height, longitude, - latitude, + latitude ) { // returns a height encoded according to the structure's heightScale and heightOffset. const fromWest = @@ -842,7 +838,7 @@ function interpolateMeshHeight( southwestHeight, southeastHeight, northwestHeight, - northeastHeight, + northeastHeight ); } @@ -852,7 +848,7 @@ function triangleInterpolateHeight( southwestHeight, southeastHeight, northwestHeight, - northeastHeight, + northeastHeight ) { // The HeightmapTessellator bisects the quad from southwest to northeast. if (dY < dX) { @@ -878,7 +874,7 @@ function getHeight( elementMultiplier, stride, isBigEndian, - index, + index ) { index *= stride; @@ -906,7 +902,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 b49e1a695e05..73c23b5e8e98 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,15 +247,16 @@ 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) - @@ -464,8 +465,9 @@ HeightmapTessellator.computeVertices = function (options) { } if (includeGeodeticSurfaceNormals) { - geodeticSurfaceNormals[index] = - ellipsoid.geodeticSurfaceNormal(position); + geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal( + position + ); } } } @@ -477,19 +479,18 @@ 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); @@ -503,7 +504,7 @@ HeightmapTessellator.computeVertices = function (options) { includeWebMercatorT, includeGeodeticSurfaceNormals, exaggeration, - exaggerationRelativeHeight, + exaggerationRelativeHeight ); const vertices = new Float32Array(vertexCount * encoding.stride); @@ -517,7 +518,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 e8cab0d6fa28..c2737cd26d28 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 bad84e49c200..629e81e7687a 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 768ad47e23d0..540a1ea493b4 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 86849d1756d6..c09aec64a55c 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 7c590f89b10e..098867325578 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 5531e1af0f1d..ba72c47384e6 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 ccd8373f9033..6a31e2ce9426 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 4ba53f228c12..295b467bdb45 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,10 +920,17 @@ 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) { @@ -934,10 +941,17 @@ 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) { @@ -948,10 +962,17 @@ 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, ], }; } @@ -964,10 +985,17 @@ 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) { @@ -978,10 +1006,17 @@ 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) { @@ -992,10 +1027,17 @@ 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 aabc0cd5561d..df98e06093db 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 81da96b7dbba..7ff6f6260d2d 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 c9cc74bca53e..b0dfe6bd43ff 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 e1b2664e13d6..3b491f54c380 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 092e4683e5a8..3e8a6ec24d5e 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,9 +788,13 @@ 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 + .padStart(2, "0")}-${day + .toString() + .padStart(2, "0")}T${hour + .toString() + .padStart(2, "0")}:${minute .toString() - .padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second + .padStart(2, "0")}:${second .toString() .padStart(2, "0")}.${millisecondStr}Z`; } @@ -799,7 +803,9 @@ 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() @@ -813,9 +819,13 @@ 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 + .padStart(2, "0")}-${day + .toString() + .padStart(2, "0")}T${hour + .toString() + .padStart(2, "0")}:${minute .toString() - .padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second + .padStart(2, "0")}:${second .toString() .padStart(2, "0")}.${millisecondStr}Z`; }; @@ -835,7 +845,7 @@ JulianDate.clone = function (julianDate, result) { return new JulianDate( julianDate.dayNumber, julianDate.secondsOfDay, - TimeStandard.TAI, + TimeStandard.TAI ); } result.dayNumber = julianDate.dayNumber; @@ -981,7 +991,7 @@ JulianDate.computeTaiMinusUtc = function (julianDate) { let index = binarySearch( leapSeconds, binarySearchScratchLeapSecond, - compareLeapSecondDates, + compareLeapSecondDates ); if (index < 0) { index = ~index; @@ -1017,7 +1027,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 4e4aff9465df..f09aca0f2e99 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 7863ae49b2a5..67c15aa28fb1 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 0e46bdbca726..c605a7f4fb39 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 3c025670b704..d067d318cc26 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 150cd9aa30aa..59ae199d8dc0 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 479489d6cd93..7f0cba621c0d 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 9174f3c37096..80b4a5185c24 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 afd1949ad9f4..8babc307afeb 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 a3ff99b7555b..d566c1e604f7 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 bddaf7912839..9b693fcc6387 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 ed24dde73bf9..3ae77aa49649 100644 --- a/packages/engine/Source/Core/Occluder.js +++ b/packages/engine/Source/Core/Occluder.js @@ -91,10 +91,11 @@ Object.defineProperties(Occluder.prototype, { const cameraToOccluderVec = Cartesian3.subtract( this._occluderPosition, cameraPosition, - scratchCartesian3, + scratchCartesian3 + ); + let invCameraToOccluderDistance = Cartesian3.magnitudeSquared( + cameraToOccluderVec ); - let invCameraToOccluderDistance = - Cartesian3.magnitudeSquared(cameraToOccluderVec); const occluderRadiusSqrd = this._occluderRadius * this._occluderRadius; let horizonDistance; @@ -102,14 +103,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; @@ -118,9 +119,9 @@ Object.defineProperties(Occluder.prototype, { Cartesian3.multiplyByScalar( horizonPlaneNormal, nearPlaneDistance, - scratchCartesian3, + scratchCartesian3 ), - scratchCartesian3, + scratchCartesian3 ); } else { horizonDistance = Number.MAX_VALUE; @@ -145,7 +146,7 @@ Object.defineProperties(Occluder.prototype, { Occluder.fromBoundingSphere = function ( occluderBoundingSphere, cameraPosition, - result, + result ) { //>>includeStart('debug', pragmas.debug); if (!defined(occluderBoundingSphere)) { @@ -191,7 +192,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; @@ -225,7 +226,7 @@ const occludeePositionScratch = new Cartesian3(); Occluder.prototype.isBoundingSphereVisible = function (occludee) { const occludeePosition = Cartesian3.clone( occludee.center, - occludeePositionScratch, + occludeePositionScratch ); const occludeeRadius = occludee.radius; @@ -233,7 +234,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; @@ -243,7 +244,7 @@ Occluder.prototype.isBoundingSphereVisible = function (occludee) { tempVec = Cartesian3.subtract( occludeePosition, this._cameraPosition, - tempVec, + tempVec ); return ( temp * temp + occludeeRadius * occludeeRadius > @@ -259,7 +260,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; @@ -323,7 +324,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); @@ -335,7 +336,7 @@ Occluder.prototype.computeVisibility = function (occludeeBS) { tempVec = Cartesian3.subtract( occludeePosition, this._cameraPosition, - tempVec, + tempVec ); const cameraToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec); if ( @@ -363,7 +364,7 @@ Occluder.prototype.computeVisibility = function (occludeeBS) { tempVec = Cartesian3.subtract( occludeePosition, this._horizonPlanePosition, - tempVec, + tempVec ); return Cartesian3.dot(tempVec, this._horizonPlaneNormal) > -occludeeRadius ? Visibility.PARTIAL @@ -404,7 +405,7 @@ const occludeePointScratch = new Cartesian3(); Occluder.computeOccludeePoint = function ( occluderBoundingSphere, occludeePosition, - positions, + positions ) { //>>includeStart('debug', pragmas.debug); if (!defined(occluderBoundingSphere)) { @@ -426,7 +427,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'); @@ -434,7 +435,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); @@ -443,14 +444,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 @@ -463,7 +464,7 @@ Occluder.computeOccludeePoint = function ( occluderPlaneNormal, occluderPlaneD, aRotationVector, - positions[i], + positions[i] ); if (!tempDot) { //The position is inside the minimum radius, which is invalid @@ -485,9 +486,9 @@ Occluder.computeOccludeePoint = function ( Cartesian3.multiplyByScalar( occluderPlaneNormal, distance, - occludeePointScratch, + occludeePointScratch ), - occludeePointScratch, + occludeePointScratch ); }; @@ -512,7 +513,7 @@ Occluder.computeOccludeePointFromRectangle = function (rectangle, ellipsoid) { rectangle, ellipsoid, 0.0, - computeOccludeePointFromRectangleScratch, + computeOccludeePointFromRectangleScratch ); const bs = BoundingSphere.fromPoints(positions); @@ -522,7 +523,7 @@ Occluder.computeOccludeePointFromRectangle = function (rectangle, ellipsoid) { return Occluder.computeOccludeePoint( new BoundingSphere(ellipsoidCenter, ellipsoid.minimumRadius), bs.center, - positions, + positions ); } @@ -533,7 +534,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; @@ -569,12 +570,12 @@ Occluder._anyRotationVector = function ( Cartesian3.add( tempVec0, Cartesian3.multiplyByScalar(tempVec1, u, tempVec), - tempVec0, + tempVec0 ), occluderPosition, - tempVec0, + tempVec0 ), - tempVec0, + tempVec0 ); }; @@ -584,17 +585,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) < @@ -604,7 +605,7 @@ Occluder._rotationVector = function ( const crossProduct = Cartesian3.cross( occluderPlaneNormal, positionDirection, - positionDirection, + positionDirection ); const length = Cartesian3.magnitude(crossProduct); if (length > CesiumMath.EPSILON13) { @@ -625,12 +626,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; @@ -638,10 +639,11 @@ Occluder._horizonToPlaneNormalDotProduct = function ( let positionToOccluder = Cartesian3.subtract( occluderPosition, pos, - posScratch2, + posScratch2 + ); + const occluderToPositionDistanceSquared = Cartesian3.magnitudeSquared( + positionToOccluder ); - const occluderToPositionDistanceSquared = - Cartesian3.magnitudeSquared(positionToOccluder); const occluderRadiusSquared = occluderRadius * occluderRadius; if (occluderToPositionDistanceSquared < occluderRadiusSquared) { return false; @@ -652,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 @@ -680,7 +682,7 @@ Occluder._horizonToPlaneNormalDotProduct = function ( occluderPlaneNormal, occluderPlaneD, pos, - anyRotationVector, + anyRotationVector ); let horizonCrossDirection = Cartesian3.fromElements( tempVec.x * tempVec.x * positionToOccluder.x + @@ -692,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 0ff5c2e62c76..139a7f194f2d 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 cf4a6d392b47..c94354adfc3d 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,20 +482,19 @@ 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 @@ -510,7 +509,7 @@ OrientedBoundingBox.fromRectangle = function ( maxY, minZ, maxZ, - result, + result ); } @@ -520,11 +519,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. @@ -534,7 +533,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 = @@ -547,7 +546,7 @@ OrientedBoundingBox.fromRectangle = function ( const planeXAxis = Cartesian3.cross( planeNormal, planeYAxis, - scratchPlaneXAxis, + scratchPlaneXAxis ); plane = Plane.fromPointNormal(planeOrigin, planeNormal, scratchPlane); @@ -557,15 +556,15 @@ OrientedBoundingBox.fromRectangle = function ( latitudeNearestToEquator, maximumHeight, ellipsoid, - scratchHorizonCartesian, + scratchHorizonCartesian ); maxX = Cartesian3.dot( Plane.projectPointOntoPlane( plane, horizonCartesian, - scratchHorizonProjected, + scratchHorizonProjected ), - planeXAxis, + planeXAxis ); minX = -maxX; // symmetrical @@ -575,14 +574,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( @@ -590,7 +589,7 @@ OrientedBoundingBox.fromRectangle = function ( latitudeNearestToEquator, maximumHeight, ellipsoid, - scratchZ, + scratchZ ); minZ = Plane.getPointDistance(plane, farZ); maxZ = 0.0; // plane origin starts at maxZ already @@ -607,7 +606,7 @@ OrientedBoundingBox.fromRectangle = function ( maxY, minZ, maxZ, - result, + result ); }; @@ -632,7 +631,7 @@ OrientedBoundingBox.fromTransformation = function (transformation, result) { result.halfAxes = Matrix3.multiplyByScalar( result.halfAxes, 0.5, - result.halfAxes, + result.halfAxes ); return result; }; @@ -691,17 +690,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; @@ -894,7 +893,7 @@ OrientedBoundingBox.computePlaneDistances = function ( box, position, direction, - result, + result ) { //>>includeStart('debug', pragmas.debug); if (!defined(box)) { @@ -1117,7 +1116,7 @@ OrientedBoundingBox.computeTransformation = function (box, result) { const rotationScale = Matrix3.multiplyByUniformScale( box.halfAxes, 2.0, - scratchRotationScale, + scratchRotationScale ); return Matrix4.fromRotationTranslation(rotationScale, translation, result); }; @@ -1143,7 +1142,7 @@ OrientedBoundingBox.isOccluded = function (box, occluder) { const sphere = BoundingSphere.fromOrientedBoundingBox( box, - scratchBoundingSphere, + scratchBoundingSphere ); return !occluder.isBoundingSphereVisible(sphere); @@ -1192,13 +1191,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 5d3d60245128..2153564288b1 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 a28790bc965b..ad203f1570ca 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 2df428627bc0..30da8c2c43c1 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 9c42b739ce58..5ce65b2c9aab 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'); @@ -186,7 +186,7 @@ function update(frustum) { Check.typeOf.number.greaterThanOrEquals( "aspectRatio", frustum.aspectRatio, - 0.0, + 0.0 ); Check.typeOf.number.greaterThanOrEquals("near", frustum.near, 0.0); @@ -312,7 +312,7 @@ Object.defineProperties(PerspectiveFrustum.prototype, { PerspectiveFrustum.prototype.computeCullingVolume = function ( position, direction, - up, + up ) { update(this); return this._offCenterFrustum.computeCullingVolume(position, direction, up); @@ -353,7 +353,7 @@ PerspectiveFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result, + result ) { update(this); return this._offCenterFrustum.getPixelDimensions( @@ -361,7 +361,7 @@ PerspectiveFrustum.prototype.getPixelDimensions = function ( drawingBufferHeight, distance, pixelRatio, - result, + result ); }; @@ -427,7 +427,7 @@ PerspectiveFrustum.prototype.equals = function (other) { PerspectiveFrustum.prototype.equalsEpsilon = function ( other, relativeEpsilon, - absoluteEpsilon, + absoluteEpsilon ) { if (!defined(other) || !(other instanceof PerspectiveFrustum)) { return false; @@ -441,18 +441,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 fb4c4af981dd..4b02ccdc190f 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'); @@ -124,7 +124,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'); @@ -142,7 +142,7 @@ function update(frustum) { top, near, far, - frustum._perspectiveMatrix, + frustum._perspectiveMatrix ); frustum._infinitePerspective = Matrix4.computeInfinitePerspectiveOffCenter( left, @@ -150,7 +150,7 @@ function update(frustum) { bottom, top, near, - frustum._infinitePerspective, + frustum._infinitePerspective ); } @@ -208,7 +208,7 @@ const getPlanesNormal = new Cartesian3(); PerspectiveOffCenterFrustum.prototype.computeCullingVolume = function ( position, direction, - up, + up ) { //>>includeStart('debug', pragmas.debug); if (!defined(position)) { @@ -370,14 +370,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) { @@ -475,7 +475,7 @@ PerspectiveOffCenterFrustum.prototype.equals = function (other) { PerspectiveOffCenterFrustum.prototype.equalsEpsilon = function ( other, relativeEpsilon, - absoluteEpsilon, + absoluteEpsilon ) { return ( other === this || @@ -485,37 +485,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 85671c2771e8..143477b41c9d 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 890e1fe027a7..03de4bace70d 100644 --- a/packages/engine/Source/Core/PixelFormat.js +++ b/packages/engine/Source/Core/PixelFormat.js @@ -63,6 +63,15 @@ const PixelFormat = { */ RGBA: WebGLConstants.RGBA, + /** + * Integral versions of above types. Required if using integral textures. + */ + + RED_INTEGER: WebGLConstants.RED_INTEGER, + RG_INTEGER: WebGLConstants.RG_INTEGER, + RGB_INTEGER: WebGLConstants.RGB_INTEGER, + RGBA_INTEGER: WebGLConstants.RGBA_INTEGER, + /** * A pixel format containing a luminance (intensity) channel. * @@ -190,14 +199,18 @@ const PixelFormat = { PixelFormat.componentsLength = function (pixelFormat) { switch (pixelFormat) { case PixelFormat.RGB: + case PixelFormat.RGB_INTEGER: return 3; case PixelFormat.RGBA: + case PixelFormat.RGBA_INTEGER: return 4; case PixelFormat.LUMINANCE_ALPHA: case PixelFormat.RG: + case PixelFormat.RG_INTEGER: return 2; case PixelFormat.ALPHA: case PixelFormat.RED: + case PixelFormat.RED_INTEGER: case PixelFormat.LUMINANCE: return 1; default: @@ -217,6 +230,10 @@ PixelFormat.validate = function (pixelFormat) { pixelFormat === PixelFormat.RG || pixelFormat === PixelFormat.RGB || pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.RED_INTEGER || + pixelFormat === PixelFormat.RG_INTEGER || + pixelFormat === PixelFormat.RGB_INTEGER || + pixelFormat === PixelFormat.RGBA_INTEGER || pixelFormat === PixelFormat.LUMINANCE || pixelFormat === PixelFormat.LUMINANCE_ALPHA || pixelFormat === PixelFormat.RGB_DXT1 || @@ -499,6 +516,32 @@ PixelFormat.toInternalFormat = function (pixelFormat, pixelDatatype, context) { } } + if (pixelDatatype === PixelDatatype.INT) { + switch (pixelFormat) { + case PixelFormat.RGBA_INTEGER: + return WebGLConstants.RGBA32I; + case PixelFormat.RGB_INTEGER: + return WebGLConstants.RGB32I; + case PixelFormat.RG_INTEGER: + return WebGLConstants.RG32I; + case PixelFormat.RED_INTEGER: + return WebGLConstants.R32I; + } + } + + if (pixelDatatype === PixelDatatype.UNSIGNED_INT) { + switch (pixelFormat) { + case PixelFormat.RGBA_INTEGER: + return WebGLConstants.RGBA32UI; + case PixelFormat.RGB_INTEGER: + return WebGLConstants.RGB32UI; + case PixelFormat.RG_INTEGER: + return WebGLConstants.RG32UI; + case PixelFormat.RED_INTEGER: + return WebGLConstants.R32UI; + } + } + return pixelFormat; }; diff --git a/packages/engine/Source/Core/Plane.js b/packages/engine/Source/Core/Plane.js index 9344486e9d2c..ab9ee77567c9 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 cfc96a536ae7..8bc861fd149f 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 de5ab60ecf30..bdc605861b8d 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,27 +1388,25 @@ 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) { @@ -1426,7 +1424,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { height, extrudedHeight, ellipsoid, - perPositionHeight, + perPositionHeight ); wall.geometry = computeAttributes(options); geometries.push(wall); @@ -1442,16 +1440,15 @@ 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); @@ -1464,12 +1461,13 @@ 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); @@ -1478,16 +1476,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) { @@ -1509,7 +1507,7 @@ PolygonGeometry.createGeometry = function (polygonGeometry) { PolygonGeometry.createShadowVolume = function ( polygonGeometry, minHeightFunc, - maxHeightFunc, + maxHeightFunc ) { const granularity = polygonGeometry._granularity; const ellipsoid = polygonGeometry._ellipsoid; @@ -1543,7 +1541,7 @@ function textureCoordinateRotationPoints(polygonGeometry) { positions, stRotation, ellipsoid, - boundingRectangle, + boundingRectangle ); } @@ -1558,7 +1556,7 @@ Object.defineProperties(PolygonGeometry.prototype, { this._rectangle = PolygonGeometry.computeRectangleFromPositions( positions, this._ellipsoid, - this._arcType, + this._arcType ); } @@ -1572,8 +1570,9 @@ 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 ef288ae330df..432bb3f3bdc0 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,8 +799,9 @@ 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(); @@ -839,7 +840,7 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( holePositions = arrayRemoveDuplicates( holePositions, Cartesian3.equalsEpsilon, - true, + true ); } if (holePositions.length < 3) { @@ -851,8 +852,9 @@ PolygonGeometryLibrary.polygonsFromHierarchy = function ( continue; } - originalWindingOrder = - PolygonPipeline.computeWindingOrder2D(holePositions2D); + originalWindingOrder = PolygonPipeline.computeWindingOrder2D( + holePositions2D + ); if (originalWindingOrder === WindingOrder.CLOCKWISE) { holePositions2D.reverse(); holePositions = holePositions.slice().reverse(); @@ -899,16 +901,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; @@ -920,7 +922,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); @@ -948,7 +950,7 @@ PolygonGeometryLibrary.createGeometryFromPositions = function ( granularity, perPositionHeight, vertexFormat, - arcType, + arcType ) { let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes); @@ -1008,7 +1010,7 @@ PolygonGeometryLibrary.createGeometryFromPositions = function ( positions, indices, texcoords, - granularity, + granularity ); } else if (arcType === ArcType.RHUMB) { return PolygonPipeline.computeRhumbLineSubdivision( @@ -1016,7 +1018,7 @@ PolygonGeometryLibrary.createGeometryFromPositions = function ( positions, indices, texcoords, - granularity, + granularity ); } }; @@ -1032,7 +1034,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( ellipsoid, granularity, perPositionHeight, - arcType, + arcType ) { let edgePositions; let topEdgeLength; @@ -1054,7 +1056,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( if (!perPositionHeight) { const minDistance = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius, + ellipsoid.maximumRadius ); let numVertices = 0; @@ -1063,7 +1065,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( numVertices += PolygonGeometryLibrary.subdivideLineCount( positions[i], positions[(i + 1) % length], - minDistance, + minDistance ); } } else if (arcType === ArcType.RHUMB) { @@ -1072,7 +1074,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( ellipsoid, positions[i], positions[(i + 1) % length], - minDistance, + minDistance ); } } @@ -1102,7 +1104,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallIndicesSubdivided, + computeWallIndicesSubdivided ); if (hasTexcoords) { tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine( @@ -1111,7 +1113,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallTexcoordsSubdivided, + computeWallTexcoordsSubdivided ); } } else if (arcType === ArcType.RHUMB) { @@ -1120,7 +1122,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallIndicesSubdivided, + computeWallIndicesSubdivided ); if (hasTexcoords) { tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine( @@ -1130,7 +1132,7 @@ PolygonGeometryLibrary.computeWallGeometry = function ( p1, p2, minDistance, - computeWallTexcoordsSubdivided, + computeWallTexcoordsSubdivided ); } } @@ -1220,7 +1222,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; @@ -1238,7 +1240,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 f103369d1dce..638df675e395 100644 --- a/packages/engine/Source/Core/PolygonOutlineGeometry.js +++ b/packages/engine/Source/Core/PolygonOutlineGeometry.js @@ -28,16 +28,17 @@ 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(); @@ -56,7 +57,7 @@ function createGeometryFromPositions( numVertices += PolygonGeometryLibrary.subdivideLineCount( positions[i], positions[(i + 1) % length], - minDistance, + minDistance ); } } else if (arcType === ArcType.RHUMB) { @@ -65,7 +66,7 @@ function createGeometryFromPositions( ellipsoid, positions[i], positions[(i + 1) % length], - minDistance, + minDistance ); } } @@ -77,7 +78,7 @@ function createGeometryFromPositions( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided, + createGeometryFromPositionsSubdivided ); } else if (arcType === ArcType.RHUMB) { tempPositions = PolygonGeometryLibrary.subdivideRhumbLine( @@ -85,7 +86,7 @@ function createGeometryFromPositions( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided, + createGeometryFromPositionsSubdivided ); } const tempPositionsLength = tempPositions.length; @@ -138,16 +139,17 @@ 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(); @@ -167,7 +169,7 @@ function createGeometryFromPositionsExtruded( numVertices += PolygonGeometryLibrary.subdivideLineCount( positions[i], positions[(i + 1) % length], - minDistance, + minDistance ); } } else if (arcType === ArcType.RHUMB) { @@ -176,7 +178,7 @@ function createGeometryFromPositionsExtruded( ellipsoid, positions[i], positions[(i + 1) % length], - minDistance, + minDistance ); } } @@ -190,7 +192,7 @@ function createGeometryFromPositionsExtruded( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided, + createGeometryFromPositionsSubdivided ); } else if (arcType === ArcType.RHUMB) { tempPositions = PolygonGeometryLibrary.subdivideRhumbLine( @@ -198,7 +200,7 @@ function createGeometryFromPositionsExtruded( positions[i], positions[(i + 1) % length], minDistance, - createGeometryFromPositionsSubdivided, + createGeometryFromPositionsSubdivided ); } const tempPositionsLength = tempPositions.length; @@ -228,7 +230,7 @@ function createGeometryFromPositionsExtruded( const indicesSize = (length * 2 + cornersLength) * 2; const indices = IndexDatatype.createTypedArray( length + cornersLength, - indicesSize, + indicesSize ); index = 0; @@ -353,7 +355,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 ( @@ -362,7 +364,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'); @@ -371,7 +373,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 = @@ -405,7 +407,7 @@ function PolygonOutlineGeometry(options) { this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength( polygonHierarchy, - Cartesian3, + Cartesian3 ) + Ellipsoid.packedLength + 8; @@ -432,7 +434,7 @@ PolygonOutlineGeometry.pack = function (value, array, startingIndex) { value._polygonHierarchy, array, startingIndex, - Cartesian3, + Cartesian3 ); Ellipsoid.pack(value._ellipsoid, array, startingIndex); @@ -473,7 +475,7 @@ PolygonOutlineGeometry.unpack = function (array, startingIndex, result) { const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy( array, startingIndex, - Cartesian3, + Cartesian3 ); startingIndex = polygonHierarchy.startingIndex; delete polygonHierarchy.startingIndex; @@ -576,7 +578,7 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy( polygonHierarchy, !perPositionHeight, - ellipsoid, + ellipsoid ); if (polygons.length === 0) { @@ -587,7 +589,7 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { const geometries = []; const minDistance = CesiumMath.chordLength( granularity, - ellipsoid.maximumRadius, + ellipsoid.maximumRadius ); const height = polygonGeometry._height; @@ -604,16 +606,15 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { polygons[i], minDistance, perPositionHeight, - arcType, + arcType + ); + geometryInstance.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded( + geometryInstance.geometry, + height, + extrudedHeight, + ellipsoid, + perPositionHeight ); - geometryInstance.geometry = - PolygonGeometryLibrary.scaleToGeodeticHeightExtruded( - geometryInstance.geometry, - height, - extrudedHeight, - ellipsoid, - perPositionHeight, - ); if (defined(polygonGeometry._offsetAttribute)) { const size = geometryInstance.geometry.attributes.position.values.length / 3; @@ -628,12 +629,13 @@ 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); } @@ -644,15 +646,14 @@ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) { polygons[i], minDistance, perPositionHeight, - 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, - ); if (defined(polygonGeometry._offsetAttribute)) { const length = @@ -662,12 +663,13 @@ 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); @@ -676,7 +678,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 328668edb7ce..3e6bc888f2a5 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 d0f9ec3dcf68..832af1c70fff 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 62227355b99c..d4f2593a584a 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 4567b67069b7..2281749def56 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 6937caab062b..11bad45bf527 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 6ac4232b505e..9d2b3ab1878e 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 799ce4637a1d..17a0fe1031f8 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 5f2e17d49051..f3c8d45d7cad 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 487caa48e5e8..c71888ad4fae 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 b91289d9662d..333e353b7816 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 bf7bd05e5bd6..a469c068c92f 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 915a5289f909..f8e4f025539f 100644 --- a/packages/engine/Source/Core/Rectangle.js +++ b/packages/engine/Source/Core/Rectangle.js @@ -383,18 +383,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); @@ -444,7 +444,7 @@ Rectangle.clone = function (rectangle, result) { rectangle.west, rectangle.south, rectangle.east, - rectangle.north, + rectangle.north ); } @@ -547,7 +547,7 @@ Rectangle.prototype.equalsEpsilon = function (other, epsilon) { Rectangle.validate = function (rectangle) { deprecationWarning( "Rectangle.validate", - "Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124.", + "Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124." ); return Rectangle._validate(rectangle); }; @@ -571,7 +571,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); @@ -579,7 +579,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); @@ -746,10 +746,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 ( @@ -851,10 +851,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; @@ -1021,7 +1021,7 @@ Rectangle.subsection = function ( southLerp, eastLerp, northLerp, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("rectangle", rectangle); @@ -1086,7 +1086,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 2c7d5720e7eb..bb8cdb516840 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 53bfe23d43d1..f8aff645f986 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,8 +1478,9 @@ 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 d374d5f8ce95..4f4d4fd13e05 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 d831c29ffc2f..b58bc6a994b3 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 e07970bbd619..2caded8f67b9 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 6c5c6566450f..cec46808118d 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 5b3a0dc31fd9..67a05266fce4 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,10 +730,74 @@ 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 23d7a837ff8e..0c2fb86c6079 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,8 +988,7 @@ 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(); @@ -1026,7 +1025,7 @@ function ScreenSpaceEventHandler(element) { ScreenSpaceEventHandler.prototype.setInputAction = function ( action, type, - modifier, + modifier ) { //>>includeStart('debug', pragmas.debug); if (!defined(action)) { @@ -1076,7 +1075,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 b8f6a19bb3da..8aa55b72c2bc 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 355b4ef8f7ea..a5035cbd63de 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 c01eff6abc76..14246063e2f2 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 62e4374acef7..f8a182129a04 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 b268ac0076e8..5dba9c6d77e6 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 cbcfcc72c4e5..4f3242a2f0db 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 a130630f6083..5592dcafa83e 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 760a6921b03a..9eca8d863e1b 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 f24e08b018e6..d688341f25b9 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,16 +223,19 @@ 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; @@ -240,8 +243,9 @@ 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 { @@ -260,8 +264,9 @@ TerrainEncoding.prototype.encode = function ( } if (this.hasVertexNormals) { - vertexBuffer[bufferIndex++] = - AttributeCompression.octPackFloat(normalToPack); + vertexBuffer[bufferIndex++] = AttributeCompression.octPackFloat( + normalToPack + ); } if (this.hasGeodeticSurfaceNormals) { @@ -279,7 +284,7 @@ const scratchGeodeticSurfaceNormal = new Cartesian3(); TerrainEncoding.prototype.addGeodeticSurfaceNormals = function ( oldBuffer, newBuffer, - ellipsoid, + ellipsoid ) { if (this.hasGeodeticSurfaceNormals) { return; @@ -300,7 +305,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; @@ -312,7 +317,7 @@ TerrainEncoding.prototype.addGeodeticSurfaceNormals = function ( TerrainEncoding.prototype.removeGeodeticSurfaceNormals = function ( oldBuffer, - newBuffer, + newBuffer ) { if (!this.hasGeodeticSurfaceNormals) { return; @@ -343,14 +348,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; @@ -366,7 +371,7 @@ TerrainEncoding.prototype.decodePosition = function (buffer, index, result) { TerrainEncoding.prototype.getExaggeratedPosition = function ( buffer, index, - result, + result ) { result = this.decodePosition(buffer, index, result); @@ -377,14 +382,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 @@ -399,7 +404,7 @@ TerrainEncoding.prototype.getExaggeratedPosition = function ( TerrainEncoding.prototype.decodeTextureCoordinates = function ( buffer, index, - result, + result ) { if (!defined(result)) { result = new Cartesian2(); @@ -410,7 +415,7 @@ TerrainEncoding.prototype.decodeTextureCoordinates = function ( if (this.quantization === TerrainQuantization.BITS12) { return AttributeCompression.decompressTextureCoordinates( buffer[index + 2], - result, + result ); } @@ -423,7 +428,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 @@ -439,7 +444,7 @@ TerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) { if (this.quantization === TerrainQuantization.BITS12) { return AttributeCompression.decompressTextureCoordinates( buffer[index + 3], - cartesian2Scratch, + cartesian2Scratch ).x; } @@ -449,7 +454,7 @@ TerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) { TerrainEncoding.prototype.getOctEncodedNormal = function ( buffer, index, - result, + result ) { index = index * this.stride + this._offsetVertexNormal; @@ -463,7 +468,7 @@ TerrainEncoding.prototype.getOctEncodedNormal = function ( TerrainEncoding.prototype.decodeGeodeticSurfaceNormal = function ( buffer, index, - result, + result ) { index = index * this.stride + this._offsetGeodeticSurfaceNormal; @@ -536,7 +541,7 @@ TerrainEncoding.prototype.getAttributes = function (buffer) { componentsTexCoordAndNormals += this.hasVertexNormals ? 1 : 0; addAttribute( attributesIndicesNone.textureCoordAndEncodedNormals, - componentsTexCoordAndNormals, + componentsTexCoordAndNormals ); if (this.hasGeodeticSurfaceNormals) { @@ -552,7 +557,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 462947d42822..60a939b5404b 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 3098fee8b9a6..6478b2eeb3a4 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 09c58979775c..0a6a74a3eed7 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 f549689e47c9..97fd0320dcb3 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 f9bc9fb07f04..7429de380a95 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 03b0a19f0840..6350ce23ca35 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 36af68c8dec9..0d17ace07214 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,8 +893,7 @@ 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 @@ -962,7 +961,7 @@ function parseDuration(iso8601, result) { } JulianDate.toGregorianDate( JulianDate.fromIso8601(iso8601, scratchJulianDate), - result, + result ); } @@ -1032,7 +1031,7 @@ TimeIntervalCollection.fromIso8601 = function (options, result) { trailingInterval: options.trailingInterval, dataCallback: options.dataCallback, }, - result, + result ); }; @@ -1070,7 +1069,7 @@ TimeIntervalCollection.fromIso8601DateArray = function (options, result) { trailingInterval: options.trailingInterval, dataCallback: options.dataCallback, }, - result, + result ); }; @@ -1131,7 +1130,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 43c0a831dbf6..d40e9ac5cfa7 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 9aad9ff17ef1..faae113b1d2d 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,8 +300,10 @@ 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 @@ -326,7 +328,7 @@ Transforms.northEastDownToFixedFrame = */ Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator( "north", - "up", + "up" ); /** @@ -352,7 +354,7 @@ Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator( */ Transforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator( "north", - "west", + "west" ); const scratchHPRQuaternion = new Quaternion(); @@ -387,7 +389,7 @@ Transforms.headingPitchRollToFixedFrame = function ( headingPitchRoll, ellipsoid, fixedFrameTransform, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("HeadingPitchRoll", headingPitchRoll); @@ -395,17 +397,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); @@ -442,7 +444,7 @@ Transforms.headingPitchRollQuaternion = function ( headingPitchRoll, ellipsoid, fixedFrameTransform, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("HeadingPitchRoll", headingPitchRoll); @@ -453,7 +455,7 @@ Transforms.headingPitchRollQuaternion = function ( headingPitchRoll, ellipsoid, fixedFrameTransform, - scratchENUMatrix4, + scratchENUMatrix4 ); const rotation = Matrix4.getMatrix3(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); @@ -481,7 +483,7 @@ Transforms.fixedFrameToHeadingPitchRoll = function ( transform, ellipsoid, fixedFrameTransform, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.defined("transform", transform); @@ -490,7 +492,7 @@ Transforms.fixedFrameToHeadingPitchRoll = function ( ellipsoid = defaultValue(ellipsoid, Ellipsoid.default); fixedFrameTransform = defaultValue( fixedFrameTransform, - Transforms.eastNorthUpToFixedFrame, + Transforms.eastNorthUpToFixedFrame ); if (!defined(result)) { result = new HeadingPitchRoll(); @@ -505,23 +507,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); @@ -598,7 +600,7 @@ Transforms.computeTemeToPseudoFixedMatrix = function (date, result) { dateInUtc = JulianDate.addSeconds( date, -JulianDate.computeTaiMinusUtc(date), - dateInUtc, + dateInUtc ); const utcDayNumber = dateInUtc.dayNumber; const utcSecondsIntoDay = dateInUtc.secondsOfDay; @@ -633,7 +635,7 @@ Transforms.computeTemeToPseudoFixedMatrix = function (date, result) { 0.0, 0.0, 0.0, - 1.0, + 1.0 ); } result[0] = cosGha; @@ -705,7 +707,7 @@ Transforms.preloadIcrfFixed = function (timeInterval) { startDayTT, startSecondTT, stopDayTT, - stopSecondTT, + stopSecondTT ); }; @@ -866,7 +868,7 @@ const eopScratch = new EarthOrientationParametersSample( 0.0, 0.0, 0.0, - 0.0, + 0.0 ); const rotation1Scratch = new Matrix3(); const rotation2Scratch = new Matrix3(); @@ -924,7 +926,7 @@ Transforms.computeFixedToIcrfMatrix = function (date, result) { const xys = Transforms.iau2006XysData.computeXysRadians( dayTT, secondTT, - xysScratch, + xysScratch ); if (!defined(xys)) { return undefined; @@ -1023,13 +1025,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; @@ -1042,7 +1044,7 @@ Transforms.pointToGLWindowCoordinates = function ( modelViewProjectionMatrix, viewportTransformation, point, - result, + result ) { //>>includeStart('debug', pragmas.debug); if (!defined(modelViewProjectionMatrix)) { @@ -1067,7 +1069,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); @@ -1091,7 +1093,7 @@ Transforms.rotationMatrixFromPositionVelocity = function ( position, velocity, ellipsoid, - result, + result ) { //>>includeStart('debug', pragmas.debug); if (!defined(position)) { @@ -1105,7 +1107,7 @@ Transforms.rotationMatrixFromPositionVelocity = function ( const normal = defaultValue( ellipsoid, - Ellipsoid.default, + Ellipsoid.default ).geodeticSurfaceNormal(position, normalScratch); let right = Cartesian3.cross(velocity, normal, rightScratch); @@ -1152,7 +1154,7 @@ const swizzleMatrix = new Matrix4( 0.0, 0.0, 0.0, - 1.0, + 1.0 ); const scratchCartographic = new Cartographic(); @@ -1185,24 +1187,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 ); } @@ -1210,7 +1212,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); @@ -1242,28 +1244,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 16047008bc6f..f3ce144596a3 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 9291b96c0e8b..b53dabc7e3e4 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 c25b7312202a..8c38ee906e8c 100644 --- a/packages/engine/Source/Core/VRTheWorldTerrainProvider.js +++ b/packages/engine/Source/Core/VRTheWorldTerrainProvider.js @@ -49,8 +49,7 @@ 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; }; @@ -67,21 +66,20 @@ 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, + 10 + ); + terrainProviderBuilder.levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( + terrainProviderBuilder.ellipsoid, + Math.min( + terrainProviderBuilder.heightmapWidth, + terrainProviderBuilder.heightmapHeight + ), + terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0) ); - terrainProviderBuilder.levelZeroMaximumGeometricError = - TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap( - terrainProviderBuilder.ellipsoid, - Math.min( - terrainProviderBuilder.heightmapWidth, - terrainProviderBuilder.heightmapHeight, - ), - terrainProviderBuilder.tilingScheme.getNumberOfXTilesAtLevel(0), - ); const dataRectangles = xml.getElementsByTagName("DataExtent"); @@ -89,21 +87,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) ); } } @@ -119,7 +117,7 @@ function metadataFailure(resource, error, provider) { undefined, provider, defined(provider) ? provider._errorEvent : undefined, - message, + message ); throw new RuntimeError(message); @@ -312,7 +310,7 @@ VRTheWorldTerrainProvider.prototype.requestTileGeometry = function ( x, y, level, - request, + request ) { const yTiles = this._tilingScheme.getNumberOfYTilesAtLevel(level); const resource = this._resource.getDerivedResource({ @@ -348,7 +346,7 @@ VRTheWorldTerrainProvider.prototype.requestTileGeometry = function ( * @returns {number} The maximum geometric error. */ VRTheWorldTerrainProvider.prototype.getLevelMaximumGeometricError = function ( - level, + level ) { return this._levelZeroMaximumGeometricError / (1 << level); }; @@ -373,7 +371,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. @@ -388,7 +386,7 @@ function getChildMask(provider, x, y, level) { testRectangle, x * 2 + 1, y * 2, - level + 1, + level + 1 ) ) { childMask |= 8; // northeast @@ -399,7 +397,7 @@ function getChildMask(provider, x, y, level) { testRectangle, x * 2, y * 2 + 1, - level + 1, + level + 1 ) ) { childMask |= 1; // southwest @@ -410,7 +408,7 @@ function getChildMask(provider, x, y, level) { testRectangle, x * 2 + 1, y * 2 + 1, - level + 1, + level + 1 ) ) { childMask |= 2; // southeast @@ -424,7 +422,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) ); } @@ -439,7 +437,7 @@ function isTileInRectangle(tilingScheme, rectangle, x, y, level) { VRTheWorldTerrainProvider.prototype.getTileDataAvailable = function ( x, y, - level, + level ) { return undefined; }; @@ -455,7 +453,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 b1fd436fb0d3..9754d06ba676 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 1ffcf9d37b1a..5a9744691e29 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 eb2e165cef17..5599dcae75cf 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 2f713ed2c3cc..0c9fc2d43013 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 cc64fe836d74..679cf4114e4b 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 e3a3ff850c1a..c934ff18e182 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 335eaa54697a..79a7cb309ec2 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,8 +85,9 @@ 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 @@ -103,7 +104,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; @@ -137,7 +138,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 f7a81610d418..79229fda0dec 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 2ad790353286..6100dad6effd 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 e77b3aa871be..c001def63001 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 c992d6115ab1..88a1982fbb7f 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 d7286835e82c..46d76894f5b9 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 87d794fe72fd..723a34424717 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 f51c63030298..40093a8ba362 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 30f4aef87f40..ff5e2f4c51f9 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 a6eeff08fe21..ffad591f4477 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 9907028e06e6..3c0bd64cc9d4 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 a4cee9d0f9bd..8359640fc854 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 1ebaa09d7dee..c6f2c0b07e32 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 e96e060f8dd6..3c213365e3f4 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 747dc4bef8a6..cd2f2dee82f7 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 b2eec762b5a9..61c5e092b165 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 040972d14f74..99b2a8b75b60 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 454b2ec2ae89..f3bc68f6a40b 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 3a23c602d7e3..1db8a0ba0d1f 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 3145f6adb2a9..bdd950736c2b 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 baff7d8466d9..a8cff2aa4053 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 f534f841d03f..cf3f5ff7b92b 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), + this._fillProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - 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, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - 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,8 +264,7 @@ BoxGeometryUpdater.prototype._setStaticOptions = function (entity, box) { : undefined; }; -BoxGeometryUpdater.prototype._onEntityPropertyChanged = - heightReferenceOnEntityPropertyChanged; +BoxGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged; BoxGeometryUpdater.DynamicGeometryUpdater = DynamicBoxGeometryUpdater; @@ -275,19 +274,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; } @@ -296,7 +295,7 @@ DynamicBoxGeometryUpdater.prototype._isHidden = function (entity, box, time) { const position = Property.getValueOrUndefined( entity.position, time, - positionScratch, + positionScratch ); const dimensions = this._options.dimensions; return ( @@ -310,13 +309,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 05c4893a1b1c..d922d1022850 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 7c56bd377559..61909f995668 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 7535fc8518ab..6eb239dd7e6b 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 314edf37e1c1..2578ba67ade5 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 0745fbb506c1..4dfc5c297e18 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 6ed511ca4ace..26928fad14c4 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 aca6e2e61b82..56dcf75fc3cd 100644 --- a/packages/engine/Source/DataSources/CompositeEntityCollection.js +++ b/packages/engine/Source/DataSources/CompositeEntityCollection.js @@ -23,11 +23,12 @@ 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) { @@ -64,7 +65,7 @@ function recomposite(that) { collection = collectionsCopy[i]; collection.collectionChanged.removeEventListener( CompositeEntityCollection.prototype._onCollectionChanged, - that, + that ); entities = collection.values; collectionId = collection.id; @@ -78,7 +79,7 @@ function recomposite(that) { collection = collections[i]; collection.collectionChanged.addEventListener( CompositeEntityCollection.prototype._onCollectionChanged, - that, + that ); //Merge all of the existing entities. @@ -199,7 +200,7 @@ Object.defineProperties(CompositeEntityCollection.prototype, { */ CompositeEntityCollection.prototype.addCollection = function ( collection, - index, + index ) { const hasIndex = defined(index); //>>includeStart('debug', pragmas.debug); @@ -211,7 +212,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." ); } } @@ -370,7 +371,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) { @@ -390,7 +391,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) { @@ -431,7 +432,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'); @@ -471,7 +472,7 @@ CompositeEntityCollection.prototype.getById = function (id) { CompositeEntityCollection.prototype._onCollectionChanged = function ( collection, added, - removed, + removed ) { const collections = this._collectionsCopy; const collectionsLength = collections.length; @@ -545,7 +546,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 93b16ab7aecf..303d90c90c46 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,8 +74,9 @@ 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); } @@ -96,8 +97,9 @@ 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 ff50c9e169a5..202b6fe43026 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,8 +121,9 @@ 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 fa90f54ffa6e..4af69c9f0eed 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 946704d563b3..b2a436383bf5 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 b0ae56966580..74cb9d3aeaf6 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,12 +94,11 @@ CorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time), + this._fillProperty.getValue(time) + ), + distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time) ), - distanceDisplayCondition: - DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time), - ), offset: undefined, color: undefined, }; @@ -124,8 +123,8 @@ CorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -145,14 +144,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'); @@ -163,7 +162,7 @@ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor, + scratchColor ); const attributes = { @@ -171,13 +170,12 @@ 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, }; @@ -187,8 +185,8 @@ CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -202,14 +200,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 ); }; @@ -239,25 +237,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; @@ -270,36 +268,35 @@ 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, + Iso8601.MINIMUM_VALUE ); - options.offsetAttribute = - GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue, - ); - options.height = GroundGeometryUpdater.getGeometryHeight( + options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( heightValue, heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue + ); + options.height = GroundGeometryUpdater.getGeometryHeight( + heightValue, + 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; } @@ -314,28 +311,27 @@ 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 ( @@ -345,7 +341,7 @@ DynamicCorridorGeometryUpdater.prototype._isHidden = function ( this, entity, corridor, - time, + time ) ); }; @@ -353,23 +349,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; @@ -379,28 +375,27 @@ 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.height = GroundGeometryUpdater.getGeometryHeight( + options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( heightValue, heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue + ); + options.height = GroundGeometryUpdater.getGeometryHeight( + heightValue, + 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 eefe7567d8ff..b33c6ee21cd0 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 086d74834dd5..885ce2d1afb7 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), + this._fillProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - 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, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - 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,8 +291,7 @@ CylinderGeometryUpdater.prototype._setStaticOptions = function ( : undefined; }; -CylinderGeometryUpdater.prototype._onEntityPropertyChanged = - heightReferenceOnEntityPropertyChanged; +CylinderGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged; CylinderGeometryUpdater.DynamicGeometryUpdater = DynamicCylinderGeometryUpdater; @@ -302,34 +301,33 @@ 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) || @@ -340,7 +338,7 @@ DynamicCylinderGeometryUpdater.prototype._isHidden = function ( this, entity, cylinder, - time, + time ) ); }; @@ -348,24 +346,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 370e778a4e5d..9f25286c042f 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 ef48b6c9016f..b0921c3c1fa1 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,20 +1056,21 @@ 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); @@ -1081,12 +1082,13 @@ 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. @@ -1101,7 +1103,7 @@ function processPositionProperty( interval = combinedInterval.clone(); interval.data = new SampledPositionProperty( referenceFrame, - numberOfDerivatives, + numberOfDerivatives ); intervals.addInterval(interval); } @@ -1122,7 +1124,7 @@ function removePositionPropertyData(property, interval) { const intersection = TimeInterval.intersect( intervals.get(i), interval, - scratchTimeInterval, + scratchTimeInterval ); if (!intersection.isEmpty) { // remove data from the contained properties @@ -1141,7 +1143,7 @@ function processPositionPacketData( packetData, interval, sourceUri, - entityCollection, + entityCollection ) { if (!defined(packetData)) { return; @@ -1155,7 +1157,7 @@ function processPositionPacketData( packetData[i], interval, sourceUri, - entityCollection, + entityCollection ); } } else { @@ -1165,7 +1167,7 @@ function processPositionPacketData( packetData, interval, sourceUri, - entityCollection, + entityCollection ); } } @@ -1174,7 +1176,7 @@ function processShapePacketData( object, propertyName, packetData, - entityCollection, + entityCollection ) { if (defined(packetData.references)) { processReferencesArrayPacketData( @@ -1184,7 +1186,7 @@ function processShapePacketData( packetData.interval, entityCollection, PropertyArray, - CompositeProperty, + CompositeProperty ); } else { if (defined(packetData.cartesian2)) { @@ -1202,7 +1204,7 @@ function processShapePacketData( packetData, undefined, undefined, - entityCollection, + entityCollection ); } } @@ -1214,7 +1216,7 @@ function processMaterialProperty( packetData, constrainedInterval, sourceUri, - entityCollection, + entityCollection ) { let combinedInterval = intervalFromString(packetData.interval); if (defined(constrainedInterval)) { @@ -1222,7 +1224,7 @@ function processMaterialProperty( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval, + scratchTimeInterval ); } else { combinedInterval = constrainedInterval; @@ -1270,7 +1272,7 @@ function processMaterialProperty( materialData.color, undefined, undefined, - entityCollection, + entityCollection ); } else if (defined(packetData.grid)) { if (!(existingMaterial instanceof GridMaterialProperty)) { @@ -1284,7 +1286,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1293,7 +1295,7 @@ function processMaterialProperty( materialData.cellAlpha, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -1302,7 +1304,7 @@ function processMaterialProperty( materialData.lineCount, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -1311,7 +1313,7 @@ function processMaterialProperty( materialData.lineThickness, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -1320,7 +1322,7 @@ function processMaterialProperty( materialData.lineOffset, undefined, sourceUri, - entityCollection, + entityCollection ); } else if (defined(packetData.image)) { if (!(existingMaterial instanceof ImageMaterialProperty)) { @@ -1334,7 +1336,7 @@ function processMaterialProperty( materialData.image, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -1343,7 +1345,7 @@ function processMaterialProperty( materialData.repeat, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -1352,7 +1354,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -1361,7 +1363,7 @@ function processMaterialProperty( materialData.transparent, undefined, sourceUri, - entityCollection, + entityCollection ); } else if (defined(packetData.stripe)) { if (!(existingMaterial instanceof StripeMaterialProperty)) { @@ -1375,7 +1377,7 @@ function processMaterialProperty( materialData.orientation, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -1384,7 +1386,7 @@ function processMaterialProperty( materialData.evenColor, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -1393,7 +1395,7 @@ function processMaterialProperty( materialData.oddColor, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1402,7 +1404,7 @@ function processMaterialProperty( materialData.offset, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1411,7 +1413,7 @@ function processMaterialProperty( materialData.repeat, undefined, sourceUri, - entityCollection, + entityCollection ); } else if (defined(packetData.polylineOutline)) { if (!(existingMaterial instanceof PolylineOutlineMaterialProperty)) { @@ -1425,7 +1427,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -1434,7 +1436,7 @@ function processMaterialProperty( materialData.outlineColor, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1443,7 +1445,7 @@ function processMaterialProperty( materialData.outlineWidth, undefined, sourceUri, - entityCollection, + entityCollection ); } else if (defined(packetData.polylineGlow)) { if (!(existingMaterial instanceof PolylineGlowMaterialProperty)) { @@ -1457,7 +1459,7 @@ function processMaterialProperty( materialData.color, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1466,7 +1468,7 @@ function processMaterialProperty( materialData.glowPower, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1475,7 +1477,7 @@ function processMaterialProperty( materialData.taperPower, undefined, sourceUri, - entityCollection, + entityCollection ); } else if (defined(packetData.polylineArrow)) { if (!(existingMaterial instanceof PolylineArrowMaterialProperty)) { @@ -1489,7 +1491,7 @@ function processMaterialProperty( materialData.color, undefined, undefined, - entityCollection, + entityCollection ); } else if (defined(packetData.polylineDash)) { if (!(existingMaterial instanceof PolylineDashMaterialProperty)) { @@ -1503,7 +1505,7 @@ function processMaterialProperty( materialData.color, undefined, undefined, - entityCollection, + entityCollection ); processPacketData( Color, @@ -1512,7 +1514,7 @@ function processMaterialProperty( materialData.gapColor, undefined, undefined, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1521,7 +1523,7 @@ function processMaterialProperty( materialData.dashLength, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -1530,7 +1532,7 @@ function processMaterialProperty( materialData.dashPattern, undefined, sourceUri, - entityCollection, + entityCollection ); } else if (defined(packetData.checkerboard)) { if (!(existingMaterial instanceof CheckerboardMaterialProperty)) { @@ -1544,7 +1546,7 @@ function processMaterialProperty( materialData.evenColor, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -1553,7 +1555,7 @@ function processMaterialProperty( materialData.oddColor, undefined, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -1562,7 +1564,7 @@ function processMaterialProperty( materialData.repeat, undefined, sourceUri, - entityCollection, + entityCollection ); } @@ -1579,7 +1581,7 @@ function processMaterialPacketData( packetData, interval, sourceUri, - entityCollection, + entityCollection ) { if (!defined(packetData)) { return; @@ -1593,7 +1595,7 @@ function processMaterialPacketData( packetData[i], interval, sourceUri, - entityCollection, + entityCollection ); } } else { @@ -1603,7 +1605,7 @@ function processMaterialPacketData( packetData, interval, sourceUri, - entityCollection, + entityCollection ); } } @@ -1625,7 +1627,7 @@ function processDescription(entity, packet, entityCollection, sourceUri) { descriptionData, undefined, sourceUri, - entityCollection, + entityCollection ); } } @@ -1639,7 +1641,7 @@ function processPosition(entity, packet, entityCollection, sourceUri) { positionData, undefined, sourceUri, - entityCollection, + entityCollection ); } } @@ -1654,7 +1656,7 @@ function processViewFrom(entity, packet, entityCollection, sourceUri) { viewFromData, undefined, sourceUri, - entityCollection, + entityCollection ); } } @@ -1669,7 +1671,7 @@ function processOrientation(entity, packet, entityCollection, sourceUri) { orientationData, undefined, sourceUri, - entityCollection, + entityCollection ); } } @@ -1701,7 +1703,7 @@ function processProperties(entity, packet, entityCollection, sourceUri) { propertyData[i], undefined, sourceUri, - entityCollection, + entityCollection ); } } else { @@ -1712,7 +1714,7 @@ function processProperties(entity, packet, entityCollection, sourceUri) { propertyData, undefined, sourceUri, - entityCollection, + entityCollection ); } } @@ -1727,7 +1729,7 @@ function processReferencesArrayPacketData( interval, entityCollection, PropertyArrayType, - CompositePropertyArrayType, + CompositePropertyArrayType ) { const properties = references.map(function (reference) { return createReferenceProperty(entityCollection, reference); @@ -1758,7 +1760,7 @@ function processArrayPacketData( object, propertyName, packetData, - entityCollection, + entityCollection ) { const references = packetData.references; if (defined(references)) { @@ -1769,7 +1771,7 @@ function processArrayPacketData( packetData.interval, entityCollection, PropertyArray, - CompositeProperty, + CompositeProperty ); } else { processPacketData( @@ -1779,7 +1781,7 @@ function processArrayPacketData( packetData, undefined, undefined, - entityCollection, + entityCollection ); } } @@ -1795,7 +1797,7 @@ function processArray(object, propertyName, packetData, entityCollection) { object, propertyName, packetData[i], - entityCollection, + entityCollection ); } } else { @@ -1807,7 +1809,7 @@ function processPositionArrayPacketData( object, propertyName, packetData, - entityCollection, + entityCollection ) { const references = packetData.references; if (defined(references)) { @@ -1818,7 +1820,7 @@ function processPositionArrayPacketData( packetData.interval, entityCollection, PositionPropertyArray, - CompositePositionProperty, + CompositePositionProperty ); } else { if (defined(packetData.cartesian)) { @@ -1826,12 +1828,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 ); } @@ -1843,7 +1845,7 @@ function processPositionArrayPacketData( packetData, undefined, undefined, - entityCollection, + entityCollection ); } } @@ -1853,7 +1855,7 @@ function processPositionArray( object, propertyName, packetData, - entityCollection, + entityCollection ) { if (!defined(packetData)) { return; @@ -1865,7 +1867,7 @@ function processPositionArray( object, propertyName, packetData[i], - entityCollection, + entityCollection ); } } else { @@ -1873,7 +1875,7 @@ function processPositionArray( object, propertyName, packetData, - entityCollection, + entityCollection ); } } @@ -1894,7 +1896,7 @@ function processPositionArrayOfArraysPacketData( object, propertyName, packetData, - entityCollection, + entityCollection ) { const references = packetData.references; if (defined(references)) { @@ -1907,7 +1909,7 @@ function processPositionArrayOfArraysPacketData( packetData.interval, entityCollection, PositionPropertyArray, - CompositePositionProperty, + CompositePositionProperty ); return tempObj.positions; }); @@ -1917,11 +1919,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 ); } @@ -1933,7 +1935,7 @@ function processPositionArrayOfArraysPacketData( packetData, undefined, undefined, - entityCollection, + entityCollection ); } } @@ -1943,7 +1945,7 @@ function processPositionArrayOfArrays( object, propertyName, packetData, - entityCollection, + entityCollection ) { if (!defined(packetData)) { return; @@ -1955,7 +1957,7 @@ function processPositionArrayOfArrays( object, propertyName, packetData[i], - entityCollection, + entityCollection ); } } else { @@ -1963,7 +1965,7 @@ function processPositionArrayOfArrays( object, propertyName, packetData, - entityCollection, + entityCollection ); } } @@ -1979,7 +1981,7 @@ function processShape(object, propertyName, packetData, entityCollection) { object, propertyName, packetData[i], - entityCollection, + entityCollection ); } } else { @@ -2013,7 +2015,7 @@ function processAlignedAxis( packetData, interval, sourceUri, - entityCollection, + entityCollection ) { if (!defined(packetData)) { return; @@ -2026,7 +2028,7 @@ function processAlignedAxis( packetData, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -2049,7 +2051,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Image, @@ -2058,7 +2060,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.image, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2067,7 +2069,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.scale, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -2076,7 +2078,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.pixelOffset, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian3, @@ -2085,7 +2087,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.eyeOffset, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HorizontalOrigin, @@ -2094,7 +2096,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.horizontalOrigin, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( VerticalOrigin, @@ -2103,7 +2105,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.verticalOrigin, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2112,7 +2114,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -2121,7 +2123,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.color, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rotation, @@ -2130,14 +2132,14 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.rotation, interval, sourceUri, - entityCollection, + entityCollection ); processAlignedAxis( billboard, billboardData.alignedAxis, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2146,7 +2148,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.sizeInMeters, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2155,7 +2157,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.width, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2164,7 +2166,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.height, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -2173,7 +2175,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.scaleByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -2182,7 +2184,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.translucencyByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -2191,7 +2193,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.pixelOffsetScaleByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( BoundingRectangle, @@ -2200,7 +2202,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.imageSubRegion, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -2209,7 +2211,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2218,7 +2220,7 @@ function processBillboard(entity, packet, entityCollection, sourceUri) { billboardData.disableDepthTestDistance, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -2241,7 +2243,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian3, @@ -2250,7 +2252,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.dimensions, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2259,7 +2261,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2268,7 +2270,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( box, @@ -2276,7 +2278,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2285,7 +2287,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -2294,7 +2296,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2303,7 +2305,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -2312,7 +2314,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -2321,7 +2323,7 @@ function processBox(entity, packet, entityCollection, sourceUri) { boxData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -2344,13 +2346,13 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPositionArray( corridor, "positions", corridorData.positions, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2359,7 +2361,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.width, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2368,7 +2370,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.height, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2377,7 +2379,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2386,7 +2388,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.extrudedHeight, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2395,7 +2397,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.extrudedHeightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( CornerType, @@ -2404,7 +2406,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.cornerType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2413,7 +2415,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2422,7 +2424,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( corridor, @@ -2430,7 +2432,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2439,7 +2441,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -2448,7 +2450,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2457,7 +2459,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -2466,7 +2468,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -2475,7 +2477,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ClassificationType, @@ -2484,7 +2486,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.classificationType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2493,7 +2495,7 @@ function processCorridor(entity, packet, entityCollection, sourceUri) { corridorData.zIndex, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -2516,7 +2518,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2525,7 +2527,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.length, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2534,7 +2536,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.topRadius, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2543,7 +2545,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.bottomRadius, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2552,7 +2554,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2561,7 +2563,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( cylinder, @@ -2569,7 +2571,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2578,7 +2580,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -2587,7 +2589,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2596,7 +2598,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2605,7 +2607,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.numberOfVerticalLines, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2614,7 +2616,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.slices, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -2623,7 +2625,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -2632,7 +2634,7 @@ function processCylinder(entity, packet, entityCollection, sourceUri) { cylinderData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -2652,7 +2654,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." ); } @@ -2677,7 +2679,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); @@ -2705,7 +2707,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2714,7 +2716,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.semiMajorAxis, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2723,7 +2725,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.semiMinorAxis, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2732,7 +2734,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.height, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2741,7 +2743,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2750,7 +2752,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.extrudedHeight, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2759,7 +2761,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.extrudedHeightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rotation, @@ -2768,7 +2770,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.rotation, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rotation, @@ -2777,7 +2779,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.stRotation, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2786,7 +2788,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2795,7 +2797,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( ellipse, @@ -2803,7 +2805,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2812,7 +2814,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -2821,7 +2823,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2830,7 +2832,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2839,7 +2841,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.numberOfVerticalLines, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -2848,7 +2850,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -2857,7 +2859,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ClassificationType, @@ -2866,7 +2868,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.classificationType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2875,7 +2877,7 @@ function processEllipse(entity, packet, entityCollection, sourceUri) { ellipseData.zIndex, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -2898,7 +2900,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian3, @@ -2907,7 +2909,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.radii, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian3, @@ -2916,7 +2918,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.innerRadii, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2925,7 +2927,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.minimumClock, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2934,7 +2936,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.maximumClock, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2943,7 +2945,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.minimumCone, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -2952,7 +2954,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.maximumCone, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -2961,7 +2963,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2970,7 +2972,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( ellipsoid, @@ -2978,7 +2980,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -2987,7 +2989,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -2996,7 +2998,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3005,7 +3007,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3014,7 +3016,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.stackPartitions, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3023,7 +3025,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.slicePartitions, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3032,7 +3034,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.subdivisions, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -3041,7 +3043,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -3050,7 +3052,7 @@ function processEllipsoid(entity, packet, entityCollection, sourceUri) { ellipsoidData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -3073,7 +3075,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( String, @@ -3082,7 +3084,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.text, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( String, @@ -3091,7 +3093,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.font, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( LabelStyle, @@ -3100,7 +3102,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.style, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3109,7 +3111,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.scale, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3118,7 +3120,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.showBackground, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3127,7 +3129,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.backgroundColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -3136,7 +3138,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.backgroundPadding, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian2, @@ -3145,7 +3147,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.pixelOffset, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian3, @@ -3154,7 +3156,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.eyeOffset, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HorizontalOrigin, @@ -3163,7 +3165,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.horizontalOrigin, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( VerticalOrigin, @@ -3172,7 +3174,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.verticalOrigin, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -3181,7 +3183,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3190,7 +3192,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.fillColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3199,7 +3201,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3208,7 +3210,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -3217,7 +3219,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.translucencyByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -3226,7 +3228,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.pixelOffsetScaleByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -3235,7 +3237,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.scaleByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -3244,7 +3246,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3253,7 +3255,7 @@ function processLabel(entity, packet, entityCollection, sourceUri) { labelData.disableDepthTestDistance, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -3276,7 +3278,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Uri, @@ -3285,7 +3287,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.gltf, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3294,7 +3296,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.scale, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3303,7 +3305,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.minimumPixelSize, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3312,7 +3314,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.maximumScale, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3321,7 +3323,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.incrementallyLoadTextures, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3330,7 +3332,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.runAnimations, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3339,7 +3341,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.clampAnimations, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -3348,7 +3350,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -3357,7 +3359,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3366,7 +3368,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.silhouetteColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3375,7 +3377,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.silhouetteSize, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3384,7 +3386,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.color, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ColorBlendMode, @@ -3393,7 +3395,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.colorBlendMode, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3402,7 +3404,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.colorBlendAmount, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -3411,7 +3413,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { modelData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); let i, len; @@ -3424,7 +3426,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { nodeTransformationsData[i], interval, sourceUri, - entityCollection, + entityCollection ); } } else { @@ -3433,7 +3435,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { nodeTransformationsData, interval, sourceUri, - entityCollection, + entityCollection ); } } @@ -3447,7 +3449,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { articulationsData[i], interval, sourceUri, - entityCollection, + entityCollection ); } } else { @@ -3456,7 +3458,7 @@ function processModel(entity, packet, entityCollection, sourceUri) { articulationsData, interval, sourceUri, - entityCollection, + entityCollection ); } } @@ -3467,7 +3469,7 @@ function processNodeTransformations( nodeTransformationsData, constrainedInterval, sourceUri, - entityCollection, + entityCollection ) { let combinedInterval = intervalFromString(nodeTransformationsData.interval); if (defined(constrainedInterval)) { @@ -3475,7 +3477,7 @@ function processNodeTransformations( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval, + scratchTimeInterval ); } else { combinedInterval = constrainedInterval; @@ -3505,8 +3507,9 @@ function processNodeTransformations( let nodeTransformation = nodeTransformations[nodeName]; if (!defined(nodeTransformation)) { - nodeTransformations[nodeName] = nodeTransformation = - new NodeTransformationProperty(); + nodeTransformations[ + nodeName + ] = nodeTransformation = new NodeTransformationProperty(); } processPacketData( @@ -3516,7 +3519,7 @@ function processNodeTransformations( nodeTransformationData.translation, combinedInterval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Quaternion, @@ -3525,7 +3528,7 @@ function processNodeTransformations( nodeTransformationData.rotation, combinedInterval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Cartesian3, @@ -3534,7 +3537,7 @@ function processNodeTransformations( nodeTransformationData.scale, combinedInterval, sourceUri, - entityCollection, + entityCollection ); } } @@ -3544,7 +3547,7 @@ function processArticulations( articulationsData, constrainedInterval, sourceUri, - entityCollection, + entityCollection ) { let combinedInterval = intervalFromString(articulationsData.interval); if (defined(constrainedInterval)) { @@ -3552,7 +3555,7 @@ function processArticulations( combinedInterval = TimeInterval.intersect( combinedInterval, constrainedInterval, - scratchTimeInterval, + scratchTimeInterval ); } else { combinedInterval = constrainedInterval; @@ -3587,7 +3590,7 @@ function processArticulations( articulationStageData, combinedInterval, sourceUri, - entityCollection, + entityCollection ); } } @@ -3611,7 +3614,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3620,7 +3623,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.leadTime, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3629,7 +3632,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.trailTime, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3638,7 +3641,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.width, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3647,7 +3650,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.resolution, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( path, @@ -3655,7 +3658,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -3664,7 +3667,7 @@ function processPath(entity, packet, entityCollection, sourceUri) { pathData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -3687,7 +3690,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3696,7 +3699,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.pixelSize, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -3705,7 +3708,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3714,7 +3717,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.color, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3723,7 +3726,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3732,7 +3735,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -3741,7 +3744,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.scaleByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( NearFarScalar, @@ -3750,7 +3753,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.translucencyByDistance, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -3759,7 +3762,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3768,7 +3771,7 @@ function processPoint(entity, packet, entityCollection, sourceUri) { pointData.disableDepthTestDistance, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -3848,7 +3851,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.show, interval, sourceUri, - entityCollection, + entityCollection ); // adapt 'position' property producing Cartesian[] @@ -3858,13 +3861,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); @@ -3877,7 +3880,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.height, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -3886,7 +3889,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3895,7 +3898,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.extrudedHeight, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -3904,7 +3907,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.extrudedHeightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rotation, @@ -3913,7 +3916,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.stRotation, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3922,7 +3925,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3931,7 +3934,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( polygon, @@ -3939,7 +3942,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3948,7 +3951,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -3957,7 +3960,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -3966,7 +3969,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3975,7 +3978,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.perPositionHeight, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3984,7 +3987,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.closeTop, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -3993,7 +3996,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.closeBottom, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ArcType, @@ -4002,7 +4005,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.arcType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -4011,7 +4014,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -4020,7 +4023,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ClassificationType, @@ -4029,7 +4032,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.classificationType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4038,7 +4041,7 @@ function processPolygon(entity, packet, entityCollection, sourceUri) { polygonData.zIndex, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -4065,13 +4068,13 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPositionArray( polyline, "positions", polylineData.positions, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4080,7 +4083,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.width, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4089,7 +4092,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( polyline, @@ -4097,7 +4100,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.material, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( polyline, @@ -4105,7 +4108,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.depthFailMaterial, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ArcType, @@ -4114,7 +4117,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.arcType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4123,7 +4126,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.clampToGround, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -4132,7 +4135,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -4141,7 +4144,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ClassificationType, @@ -4150,7 +4153,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.classificationType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4159,7 +4162,7 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.zIndex, interval, sourceUri, - entityCollection, + entityCollection ); // for backwards compatibility, adapt CZML followSurface to arcType. @@ -4172,11 +4175,11 @@ function processPolyline(entity, packet, entityCollection, sourceUri) { polylineData.followSurface, interval, sourceUri, - entityCollection, + entityCollection ); polyline.arcType = createAdapterProperty( tempObj.followSurface, - adaptFollowSurfaceToArcType, + adaptFollowSurfaceToArcType ); } } @@ -4197,13 +4200,13 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolume, "positions", polylineVolumeData.positions, - entityCollection, + entityCollection ); processShape( polylineVolume, "shape", polylineVolumeData.shape, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4212,7 +4215,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( CornerType, @@ -4221,7 +4224,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.cornerType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4230,7 +4233,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( polylineVolume, @@ -4238,7 +4241,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4247,7 +4250,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -4256,7 +4259,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4265,7 +4268,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4274,7 +4277,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -4283,7 +4286,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -4292,7 +4295,7 @@ function processPolylineVolume(entity, packet, entityCollection, sourceUri) { polylineVolumeData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -4315,7 +4318,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rectangle, @@ -4324,7 +4327,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.coordinates, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4333,7 +4336,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.height, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -4342,7 +4345,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.heightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4351,7 +4354,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.extrudedHeight, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( HeightReference, @@ -4360,7 +4363,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.extrudedHeightReference, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rotation, @@ -4369,7 +4372,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.rotation, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Rotation, @@ -4378,7 +4381,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.stRotation, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4387,7 +4390,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4396,7 +4399,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( rectangle, @@ -4404,7 +4407,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4413,7 +4416,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -4422,7 +4425,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4431,7 +4434,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -4440,7 +4443,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -4449,7 +4452,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ClassificationType, @@ -4458,7 +4461,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.classificationType, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4467,7 +4470,7 @@ function processRectangle(entity, packet, entityCollection, sourceUri) { rectangleData.zIndex, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -4490,7 +4493,7 @@ function processTileset(entity, packet, entityCollection, sourceUri) { tilesetData.show, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Uri, @@ -4499,7 +4502,7 @@ function processTileset(entity, packet, entityCollection, sourceUri) { tilesetData.uri, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4508,7 +4511,7 @@ function processTileset(entity, packet, entityCollection, sourceUri) { tilesetData.maximumScreenSpaceError, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -4531,20 +4534,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, @@ -4553,7 +4556,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.granularity, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4562,7 +4565,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.fill, interval, sourceUri, - entityCollection, + entityCollection ); processMaterialPacketData( wall, @@ -4570,7 +4573,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.material, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Boolean, @@ -4579,7 +4582,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.outline, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Color, @@ -4588,7 +4591,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.outlineColor, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( Number, @@ -4597,7 +4600,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.outlineWidth, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( ShadowMode, @@ -4606,7 +4609,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.shadows, interval, sourceUri, - entityCollection, + entityCollection ); processPacketData( DistanceDisplayCondition, @@ -4615,7 +4618,7 @@ function processWall(entity, packet, entityCollection, sourceUri) { wallData.distanceDisplayCondition, interval, sourceUri, - entityCollection, + entityCollection ); } @@ -4624,7 +4627,7 @@ function processCzmlPacket( entityCollection, updaterFunctions, sourceUri, - dataSource, + dataSource ) { let objectId = packet.id; if (!defined(objectId)) { @@ -4635,7 +4638,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." ); } @@ -4709,13 +4712,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)) { @@ -4797,7 +4800,7 @@ function loadCzml(dataSource, czml, sourceUri, clear) { entityCollection, sourceUri, undefined, - dataSource, + dataSource ); let raiseChangedEvent = updateClock(dataSource); @@ -5141,7 +5144,7 @@ CzmlDataSource._processCzml = function ( entityCollection, sourceUri, updaterFunctions, - dataSource, + dataSource ) { updaterFunctions = defaultValue(updaterFunctions, CzmlDataSource.updaters); @@ -5152,7 +5155,7 @@ CzmlDataSource._processCzml = function ( entityCollection, updaterFunctions, sourceUri, - dataSource, + dataSource ); } } else { @@ -5161,7 +5164,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 c01bc6d7d7af..17e33f50b45a 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 c3f552a66405..be83ae2685ea 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 4540cf5a58a5..38c36bcd3d85 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 e8f8af767684..23963ef14faf 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,21 +123,24 @@ 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; @@ -149,7 +152,7 @@ DynamicGeometryUpdater.prototype.update = function (time) { appearance: appearance, asynchronous: false, shadows: shadows, - }), + }) ); } } @@ -159,12 +162,13 @@ 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( @@ -179,7 +183,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 b266277298c6..15e65434f462 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,12 +97,11 @@ EllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time), + this._fillProperty.getValue(time) + ), + distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time) ), - distanceDisplayCondition: - DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time), - ), offset: undefined, color: undefined, }; @@ -127,8 +126,8 @@ EllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -148,14 +147,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'); @@ -166,23 +165,23 @@ EllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - 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, }; @@ -192,8 +191,8 @@ EllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -240,25 +239,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; @@ -271,51 +270,50 @@ 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, + Iso8601.MINIMUM_VALUE ); - options.offsetAttribute = - GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue, - ); - options.height = GroundGeometryUpdater.getGeometryHeight( + options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( heightValue, heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue + ); + options.height = GroundGeometryUpdater.getGeometryHeight( + heightValue, + 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; } @@ -330,28 +328,27 @@ 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 ( @@ -365,23 +362,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; @@ -390,42 +387,41 @@ 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, + time ); - options.offsetAttribute = - GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue, - ); - options.height = GroundGeometryUpdater.getGeometryHeight( + options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( heightValue, heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue + ); + options.height = GroundGeometryUpdater.getGeometryHeight( + heightValue, + 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 3229900640a3..4c85aee9acf0 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 2703e2f3fb4a..cd4f89bec7a9 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), + this._fillProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - 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, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - 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,11 +342,9 @@ EllipsoidGeometryUpdater.prototype._setStaticOptions = function ( : undefined; }; -EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = - heightReferenceOnEntityPropertyChanged; +EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged; -EllipsoidGeometryUpdater.DynamicGeometryUpdater = - DynamicEllipsoidGeometryUpdater; +EllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdater; /** * @private @@ -354,13 +352,13 @@ EllipsoidGeometryUpdater.DynamicGeometryUpdater = function DynamicEllipsoidGeometryUpdater( geometryUpdater, primitives, - groundPrimitives, + groundPrimitives ) { DynamicGeometryUpdater.call( this, geometryUpdater, primitives, - groundPrimitives, + groundPrimitives ); this._scene = geometryUpdater._scene; @@ -378,10 +376,9 @@ 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) { @@ -409,7 +406,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { const radii = Property.getValueOrUndefined( ellipsoid.radii, time, - radiiScratch, + radiiScratch ); let modelMatrix = defined(radii) ? entity.computeModelMatrixForHeightReference( @@ -417,7 +414,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)) { @@ -436,57 +433,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 @@ -503,16 +500,17 @@ 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 @@ -553,7 +551,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); @@ -576,7 +574,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { const fillInstance = this._geometryUpdater.createFillGeometryInstance( time, in3D, - this._modelMatrix, + this._modelMatrix ); this._primitive = primitives.add( @@ -585,13 +583,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({ @@ -600,13 +598,14 @@ 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; @@ -631,7 +630,7 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) { if (showFill !== this._lastShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( showFill, - attributes.show, + attributes.show ); this._lastShow = showFill; } @@ -639,15 +638,16 @@ 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,33 +663,31 @@ 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 1d3ed23b6a76..ea68b330a751 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 b2b7433e29ba..42aad8019714 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 f4106792f289..9b3d59c364e0 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,10 +152,7 @@ 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); } @@ -173,7 +170,7 @@ function getScreenSpacePositions( points, scene, occluder, - entityCluster, + entityCluster ) { if (!defined(collection)) { return; @@ -251,26 +248,27 @@ 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; @@ -293,7 +291,7 @@ function createDeclutterCallback(entityCluster) { points, scene, occluder, - entityCluster, + entityCluster ); } if (entityCluster._clusterBillboards) { @@ -302,7 +300,7 @@ function createDeclutterCallback(entityCluster) { points, scene, occluder, - entityCluster, + entityCluster ); } if (entityCluster._clusterPoints) { @@ -311,7 +309,7 @@ function createDeclutterCallback(entityCluster) { points, scene, occluder, - entityCluster, + entityCluster ); } @@ -350,7 +348,7 @@ function createDeclutterCallback(entityCluster) { cluster.position, Cartesian3.ZERO, Cartesian2.ZERO, - scene, + scene ); if (!defined(coord)) { continue; @@ -414,18 +412,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; @@ -438,20 +436,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); @@ -465,7 +463,7 @@ function createDeclutterCallback(entityCluster) { const position = Cartesian3.multiplyByScalar( clusterPosition, 1.0 / numPoints, - clusterPosition, + clusterPosition ); addCluster(position, numPoints, ids, entityCluster); newClusters.push({ @@ -616,7 +614,7 @@ function createGetEntity( collectionProperty, CollectionConstructor, unusedIndicesProperty, - entityIndexProperty, + entityIndexProperty ) { return function (entity) { let collection = this[collectionProperty]; @@ -691,7 +689,7 @@ EntityCluster.prototype.getLabel = createGetEntity( "_labelCollection", LabelCollection, "_unusedLabelIndices", - "labelIndex", + "labelIndex" ); /** @@ -737,7 +735,7 @@ EntityCluster.prototype.getBillboard = createGetEntity( "_billboardCollection", BillboardCollection, "_unusedBillboardIndices", - "billboardIndex", + "billboardIndex" ); /** @@ -783,7 +781,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 48fffe489df3..67c125ff9911 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 eb4fd4c5c207..886602029b8e 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 ddc47f936447..ce8429d476ed 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 3361f2835380..ebfeefac0768 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,8 +70,9 @@ 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, { @@ -411,7 +412,7 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue, + oldValue ) { if (this._observedPropertyNames.indexOf(propertyName) === -1) { return; @@ -469,11 +470,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; @@ -521,7 +522,7 @@ GeometryUpdater.prototype._onEntityPropertyChanged = function ( */ GeometryUpdater.prototype.createDynamicUpdater = function ( primitives, - groundPrimitives, + groundPrimitives ) { //>>includeStart('debug', pragmas.debug); Check.defined("primitives", primitives); @@ -529,7 +530,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'); @@ -537,7 +538,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 cb36253b172b..6dd0ba4ec90e 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 0c975a9f698e..e2d1ed306a0f 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,10 +71,11 @@ 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, @@ -82,17 +83,18 @@ 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, @@ -100,17 +102,18 @@ 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, @@ -118,17 +121,18 @@ function GeometryVisualizer( undefined, false, i, - true, + true + ); + this._openColorBatches[ + numberOfShadowModes + i + ] = new StaticGeometryColorBatch( + primitives, + PerInstanceColorAppearance, + undefined, + false, + i, + false ); - this._openColorBatches[numberOfShadowModes + i] = - new StaticGeometryColorBatch( - primitives, - PerInstanceColorAppearance, - undefined, - false, - i, - false, - ); this._openMaterialBatches[i] = new StaticGeometryPerMaterialBatch( primitives, @@ -136,17 +140,18 @@ function GeometryVisualizer( undefined, false, i, - true, + true + ); + this._openMaterialBatches[ + numberOfShadowModes + i + ] = new StaticGeometryPerMaterialBatch( + primitives, + MaterialAppearance, + undefined, + false, + i, + false ); - this._openMaterialBatches[numberOfShadowModes + i] = - new StaticGeometryPerMaterialBatch( - primitives, - MaterialAppearance, - undefined, - false, - i, - false, - ); } const numberOfClassificationTypes = @@ -159,19 +164,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 ); } } @@ -188,7 +193,7 @@ function GeometryVisualizer( this._openMaterialBatches, this._groundColorBatches, this._groundMaterialBatches, - this._dynamicBatch, + this._dynamicBatch ); this._subscriptions = new AssociativeArray(); @@ -197,12 +202,12 @@ function GeometryVisualizer( this._entityCollection = entityCollection; entityCollection.collectionChanged.addEventListener( GeometryVisualizer.prototype._onCollectionChanged, - this, + this ); this._onCollectionChanged( entityCollection, entityCollection.values, - emptyArray, + emptyArray ); } @@ -294,8 +299,8 @@ GeometryVisualizer.prototype.update = function (time) { id, updaterSet.geometryChanged.addEventListener( GeometryVisualizer._onGeometryChanged, - this, - ), + this + ) ); } @@ -353,7 +358,7 @@ GeometryVisualizer.prototype.getBoundingSphere = function (entity, result) { } else if (state === BoundingSphereState.DONE) { boundingSpheres[count] = BoundingSphere.clone( tmp, - boundingSpheres[count], + boundingSpheres[count] ); count++; } @@ -384,7 +389,7 @@ GeometryVisualizer.prototype.isDestroyed = function () { GeometryVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( GeometryVisualizer.prototype._onCollectionChanged, - this, + this ); this._addedObjects.removeAll(); this._removedObjects.removeAll(); @@ -429,7 +434,7 @@ GeometryVisualizer.prototype._removeUpdater = function (updater) { */ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( time, - updater, + updater ) { if (updater.isDynamic) { this._dynamicBatch.add(time, updater); @@ -452,8 +457,9 @@ 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 { @@ -465,7 +471,7 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( if (defined(updater.terrainOffsetProperty)) { this._closedColorBatches[numberOfShadowModes + shadows].add( time, - updater, + updater ); } else { this._closedColorBatches[shadows].add(time, updater); @@ -473,7 +479,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); @@ -482,7 +488,7 @@ GeometryVisualizer.prototype._insertUpdaterIntoBatch = function ( if (defined(updater.terrainOffsetProperty)) { this._openColorBatches[numberOfShadowModes + shadows].add( time, - updater, + updater ); } else { this._openColorBatches[shadows].add(time, updater); @@ -490,7 +496,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); @@ -519,7 +525,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 8f17fb5e6a68..887af0f2c47d 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 46436b15a928..77ea417ec67c 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 1bbdc14788b2..438b483dd0ae 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 2e4122bc0f8f..97f00224bc02 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 012387fdd356..d800e7d9a64b 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, "")}`; } text += ""; @@ -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 3067bb8934ad..0622b72bb66c 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 ebd4daa3cf5a..e88281164f29 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 58f6d142694a..1814566bad1c 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 42d1bd177592..ab326dbc44c3 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,84 +197,83 @@ 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, + defaultClampAnimations + ); + model.imageBasedLighting.imageBasedLightingFactor = Property.getValueOrDefault( + modelGraphics._imageBasedLightingFactor, + time, + defaultImageBasedLightingFactor ); - model.imageBasedLighting.imageBasedLightingFactor = - Property.getValueOrDefault( - modelGraphics._imageBasedLightingFactor, - time, - defaultImageBasedLightingFactor, - ); let lightColor = Property.getValueOrUndefined( modelGraphics._lightColor, - time, + time ); // Convert from Color to Cartesian3 @@ -286,7 +285,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 @@ -297,7 +296,7 @@ ModelVisualizer.prototype.update = function (time) { const runAnimations = Property.getValueOrDefault( modelGraphics._runAnimations, time, - true, + true ); if (modelData.animationsRunning !== runAnimations) { if (runAnimations) { @@ -314,7 +313,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); @@ -337,12 +336,12 @@ ModelVisualizer.prototype.update = function (time) { const transformationMatrix = Matrix4.fromTranslationRotationScale( nodeTransformation, - nodeMatrixScratch, + nodeMatrixScratch ); modelNode.matrix = Matrix4.multiply( modelNode.originalMatrix, transformationMatrix, - transformationMatrix, + transformationMatrix ); } } @@ -352,7 +351,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); @@ -397,7 +396,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; @@ -460,7 +459,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); @@ -488,7 +487,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 8d0f121fb957..b71017dc363a 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 8cc59662726a..d914bb4424e6 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 fd5f63d6947f..6c99fc36815a 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 204face996e1..b700e57663ab 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), + this._fillProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - 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,10 +174,11 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { this._outlineColorProperty, time, Color.BLACK, - scratchColor, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - const distanceDisplayCondition = - this._distanceDisplayConditionProperty.getValue(time); const planeGraphics = entity.plane; const options = this._options; @@ -185,12 +186,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; @@ -200,7 +201,7 @@ PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { plane, dimensions, modelMatrix, - modelMatrix, + modelMatrix ); return new GeometryInstance({ @@ -212,13 +213,12 @@ 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,34 +269,33 @@ 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) || @@ -309,14 +308,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 ); }; @@ -334,7 +333,7 @@ function createPrimitiveMatrix(plane, dimensions, transform, result) { const translation = Cartesian3.multiplyByScalar( normal, -distance, - scratchTranslation, + scratchTranslation ); let up = Cartesian3.clone(Cartesian3.UNIT_Z, scratchUp); @@ -342,7 +341,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); @@ -362,18 +361,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 bf938525c17e..519ff7d449f1 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 1a38dabfac98..87cacbeb827f 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 26b5404fca8e..0fe2f9f00c81 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 72899f1672ac..117c662f6577 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,12 +112,11 @@ PolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) { isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time), + this._fillProperty.getValue(time) + ), + distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time) ), - distanceDisplayCondition: - DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time), - ), offset: undefined, color: undefined, }; @@ -141,8 +140,8 @@ PolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) { this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -169,14 +168,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'); @@ -188,23 +187,23 @@ PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - 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, }; @@ -214,8 +213,8 @@ PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -235,7 +234,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; @@ -249,7 +248,7 @@ PolygonGeometryUpdater.prototype._computeCenter = function (time, result) { const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid); const positions2D = tangentPlane.projectPointsOntoPlane( positions, - scratch2DPositions, + scratch2DPositions ); const length = positions2D.length; @@ -284,7 +283,7 @@ PolygonGeometryUpdater.prototype._isOnTerrain = function (entity, polygon) { const onTerrain = GroundGeometryUpdater.prototype._isOnTerrain.call( this, entity, - polygon, + polygon ); const perPositionHeightProperty = polygon.perPositionHeight; const perPositionHeightEnabled = @@ -317,7 +316,7 @@ PolygonGeometryUpdater.prototype._isDynamic = function (entity, polygon) { PolygonGeometryUpdater.prototype._setStaticOptions = function ( entity, - polygon, + polygon ) { const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty; @@ -330,31 +329,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; @@ -378,57 +377,56 @@ 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; @@ -453,28 +451,27 @@ 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) || @@ -485,38 +482,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; @@ -541,7 +538,7 @@ DyanmicPolygonGeometryUpdater.prototype._setOptions = function ( heightValue, heightReferenceValue, extrudedHeightValue, - extrudedHeightReferenceValue, + extrudedHeightReferenceValue ); } @@ -549,41 +546,40 @@ 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 d6897a82810a..8e45da5edd5c 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 9f203546db9a..0550b9f46992 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 f724520f22fc..3335017ba128 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 8776e44ada01..e70b4583e483 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), + isAvailable && entity.isShowing && this._showProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - const distanceDisplayCondition = - this._distanceDisplayConditionProperty.getValue(time); - const distanceDisplayConditionAttribute = - DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition, - ); const attributes = { show: show, @@ -420,14 +420,15 @@ 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({ @@ -446,11 +447,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'); }; @@ -478,7 +479,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( entity, propertyName, newValue, - oldValue, + oldValue ) { if (!(propertyName === "availability" || propertyName === "polyline")) { return; @@ -519,11 +520,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); @@ -549,7 +550,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, @@ -597,7 +598,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." ); } @@ -618,7 +619,7 @@ PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function ( */ PolylineGeometryUpdater.prototype.createDynamicUpdater = function ( primitives, - groundPrimitives, + groundPrimitives ) { //>>includeStart('debug', pragmas.debug); Check.defined("primitives", primitives); @@ -626,7 +627,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'); @@ -686,28 +687,31 @@ 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, + ArcType.GEODESIC + ); + geometryUpdater._groundGeometryOptions.granularity = Property.getValueOrDefault( + polyline._granularity, + time, + 9999 ); - geometryUpdater._groundGeometryOptions.granularity = - Property.getValueOrDefault(polyline._granularity, time, 9999); const groundPrimitives = this._groundPrimitives; @@ -737,7 +741,7 @@ DynamicGeometryUpdater.prototype.update = function (time) { const material = MaterialProperty.getValue( time, fillMaterialProperty, - this._material, + this._material ); appearance = new PolylineMaterialAppearance({ material: material, @@ -750,11 +754,12 @@ 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 @@ -790,19 +795,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 ); } } @@ -812,13 +817,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 ); }; @@ -841,7 +846,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 7cdb799d6f23..50b5c2db007a 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 dccb69badc04..68c00789e036 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 8ca6563a6049..bb13942d3736 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 8cf4745b0f73..a30fb2fad7be 100644 --- a/packages/engine/Source/DataSources/PolylineVisualizer.js +++ b/packages/engine/Source/DataSources/PolylineVisualizer.js @@ -35,8 +35,9 @@ 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; } @@ -82,7 +83,7 @@ function PolylineVisualizer( scene, entityCollection, primitives, - groundPrimitives, + groundPrimitives ) { //>>includeStart('debug', pragmas.debug); Check.defined("scene", scene); @@ -110,14 +111,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( @@ -125,33 +126,36 @@ 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); @@ -163,14 +167,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(); @@ -179,12 +183,12 @@ function PolylineVisualizer( this._entityCollection = entityCollection; entityCollection.collectionChanged.addEventListener( PolylineVisualizer.prototype._onCollectionChanged, - this, + this ); this._onCollectionChanged( entityCollection, entityCollection.values, - emptyArray, + emptyArray ); } @@ -253,8 +257,8 @@ PolylineVisualizer.prototype.update = function (time) { id, updater.geometryChanged.addEventListener( PolylineVisualizer._onGeometryChanged, - this, - ), + this + ) ); } @@ -307,7 +311,7 @@ PolylineVisualizer.prototype.getBoundingSphere = function (entity, result) { } else if (state === BoundingSphereState.DONE) { boundingSpheres[count] = BoundingSphere.clone( tmp, - boundingSpheres[count], + boundingSpheres[count] ); count++; } @@ -337,7 +341,7 @@ PolylineVisualizer.prototype.isDestroyed = function () { PolylineVisualizer.prototype.destroy = function () { this._entityCollection.collectionChanged.removeEventListener( PolylineVisualizer.prototype._onCollectionChanged, - this, + this ); this._addedObjects.removeAll(); this._removedObjects.removeAll(); @@ -379,7 +383,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 a9ed1192c34a..1d8aca1a3d94 100644 --- a/packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js +++ b/packages/engine/Source/DataSources/PolylineVolumeGeometryUpdater.js @@ -49,16 +49,15 @@ 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; } /** @@ -70,14 +69,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'); @@ -92,14 +91,14 @@ PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function ( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time), + this._fillProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - const distanceDisplayCondition = - this._distanceDisplayConditionProperty.getValue(time); - const distanceDisplayConditionAttribute = - DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - distanceDisplayCondition, - ); if (this._materialProperty instanceof ColorMaterialProperty) { let currentColor; if ( @@ -139,51 +138,52 @@ 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); - - if (!this._outlineEnabled) { - throw new DeveloperError( - "This instance does not represent an outlined geometry.", - ); - } - //>>includeEnd('debug'); +PolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance = function ( + time +) { + //>>includeStart('debug', pragmas.debug); + Check.defined("time", time); - const entity = this._entity; - const isAvailable = entity.isAvailable(time); - const outlineColor = Property.getValueOrDefault( - this._outlineColorProperty, - time, - Color.BLACK, - scratchColor, + if (!this._outlineEnabled) { + throw new DeveloperError( + "This instance does not represent an outlined geometry." ); - const distanceDisplayCondition = - this._distanceDisplayConditionProperty.getValue(time); + } + //>>includeEnd('debug'); - 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, - ), - }, - }); - }; + 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 + ), + }, + }); +}; 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,8 +234,7 @@ PolylineVolumeGeometryUpdater.prototype._setStaticOptions = function ( : undefined; }; -PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = - DynamicPolylineVolumeGeometryUpdater; +PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = DynamicPolylineVolumeGeometryUpdater; /** * @private @@ -243,28 +242,27 @@ PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = 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 ( @@ -274,7 +272,7 @@ DynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function ( this, entity, polylineVolume, - time, + time ) ); }; @@ -282,25 +280,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 dc4abc23d478..19ff7e271c99 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 d49308ca6a0e..17bce66ed195 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 b8bdc8394731..fc8c3f4e54b5 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 2833df6cef06..49092eb3ebff 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 2dbbad4c9494..b0a1322d865c 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 01f2e34efae0..f98a3305aab8 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 e9821d061702..1633ad3ab709 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,12 +105,11 @@ RectangleGeometryUpdater.prototype.createFillGeometryInstance = function ( isAvailable && entity.isShowing && this._showProperty.getValue(time) && - this._fillProperty.getValue(time), + this._fillProperty.getValue(time) + ), + distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + this._distanceDisplayConditionProperty.getValue(time) ), - distanceDisplayCondition: - DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( - this._distanceDisplayConditionProperty.getValue(time), - ), offset: undefined, color: undefined, }; @@ -134,8 +133,8 @@ RectangleGeometryUpdater.prototype.createFillGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -155,14 +154,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'); @@ -173,23 +172,23 @@ RectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._outlineColorProperty, time, Color.BLACK, - scratchColor, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - 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, }; @@ -199,8 +198,8 @@ RectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function ( this._terrainOffsetProperty, time, defaultOffset, - offsetScratch, - ), + offsetScratch + ) ); } @@ -215,7 +214,7 @@ RectangleGeometryUpdater.prototype._computeCenter = function (time, result) { const rect = Property.getValueOrUndefined( this._entity.rectangle.coordinates, time, - scratchCenterRect, + scratchCenterRect ); if (!defined(rect)) { return; @@ -249,28 +248,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; @@ -282,47 +281,45 @@ 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, + Iso8601.MINIMUM_VALUE ); - options.offsetAttribute = - GroundGeometryUpdater.computeGeometryOffsetAttribute( - heightValue, - heightReferenceValue, - extrudedHeightValue, - extrudedHeightReferenceValue, - ); - options.height = GroundGeometryUpdater.getGeometryHeight( + options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( heightValue, heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue + ); + options.height = GroundGeometryUpdater.getGeometryHeight( + heightValue, + 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 @@ -330,28 +327,27 @@ RectangleGeometryUpdater.DynamicGeometryUpdater = 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) || @@ -359,7 +355,7 @@ DynamicRectangleGeometryUpdater.prototype._isHidden = function ( this, entity, rectangle, - time, + time ) ); }; @@ -367,23 +363,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; @@ -392,33 +388,32 @@ 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.height = GroundGeometryUpdater.getGeometryHeight( + options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute( heightValue, heightReferenceValue, + extrudedHeightValue, + extrudedHeightReferenceValue + ); + options.height = GroundGeometryUpdater.getGeometryHeight( + heightValue, + 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 b2cedf2fd4b9..020f96e56d14 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 9e9f3dd73712..175c3e41705f 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 9e337dd463fb..5f60a4a92fe8 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 c8cc2c53a7d6..fb72ce8aae8f 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 803555188725..2c015283c4f9 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 3fd1926d931d..ec89e9386674 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 4d65ea05dd8a..fde70acb1b51 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,11 +51,10 @@ 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; } @@ -92,13 +91,16 @@ 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); + } + }) ); } }; @@ -144,7 +146,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial, + this.depthFailMaterial ); } depthFailAppearance = new this.depthFailAppearanceType({ @@ -197,7 +199,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial, + this.depthFailMaterial ); this.primitive.depthFailAppearance.material = this.depthFailMaterial; } @@ -221,16 +223,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) || @@ -251,16 +253,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 ); } } @@ -272,7 +274,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show, + attributes.show ); } @@ -283,24 +285,22 @@ 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 32c078c123fc..0efdf9ac7aae 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,11 +44,10 @@ 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(); } @@ -93,13 +92,16 @@ 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; @@ -144,7 +146,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material, + this.material ); let depthFailAppearance; @@ -152,7 +154,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial, + this.depthFailMaterial ); depthFailAppearance = new this.depthFailAppearanceType({ material: this.depthFailMaterial, @@ -201,7 +203,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material, + this.material ); this.primitive.appearance.material = this.material; @@ -212,7 +214,7 @@ Batch.prototype.update = function (time) { this.depthFailMaterial = MaterialProperty.getValue( time, this.depthFailMaterialProperty, - this.depthFailMaterial, + this.depthFailMaterial ); this.primitive.depthFailAppearance.material = this.depthFailMaterial; } @@ -240,16 +242,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 ); } } @@ -260,7 +262,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show, + attributes.show ); } @@ -271,24 +273,22 @@ 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 4bde462f4505..54c5a9ee95a9 100644 --- a/packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js +++ b/packages/engine/Source/DataSources/StaticGroundGeometryColorBatch.js @@ -54,13 +54,16 @@ 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); + } + }) ); } }; @@ -72,7 +75,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); @@ -154,14 +157,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 ); } } @@ -173,7 +176,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show, + attributes.show ); } @@ -184,24 +187,22 @@ 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 + ); } } } @@ -233,7 +234,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]; } @@ -309,7 +310,7 @@ StaticGroundGeometryColorBatch.prototype.add = function (time, updater) { this._primitives, this._classificationType, instance.attributes.color.value, - zIndex, + zIndex ); batches.push(batch); } @@ -370,7 +371,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 2d2757fc3b77..c162597ec714 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,11 +36,10 @@ 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; @@ -88,13 +87,16 @@ 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; @@ -107,7 +109,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); @@ -143,7 +145,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material, + this.material ); primitive = new GroundPrimitive({ @@ -184,7 +186,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material, + this.material ); this.primitive.appearance.material = this.material; @@ -207,7 +209,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show, + attributes.show ); } @@ -218,24 +220,22 @@ 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,10 +326,9 @@ 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) @@ -355,7 +354,7 @@ StaticGroundGeometryPerMaterialBatch.prototype.add = function (time, updater) { this._appearanceType, updater.fillMaterialProperty, usingSphericalTextureCoordinates, - zIndex, + zIndex ); batch.add(time, updater, geometryInstance); items.push(batch); @@ -403,7 +402,7 @@ StaticGroundGeometryPerMaterialBatch.prototype.update = function (time) { StaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere = function ( updater, - result, + result ) { const items = this._items; const length = items.length; @@ -416,13 +415,12 @@ 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 10cf346cf058..c1284c71d9ed 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,11 +46,10 @@ 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; @@ -93,13 +92,16 @@ 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; @@ -152,7 +154,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material, + this.material ); primitive.appearance.material = this.material; } @@ -185,7 +187,7 @@ Batch.prototype.update = function (time) { this.material = MaterialProperty.getValue( time, this.materialProperty, - this.material, + this.material ); this.primitive.appearance.material = this.material; } @@ -208,16 +210,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 ); } } @@ -228,7 +230,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show, + attributes.show ); } @@ -239,24 +241,22 @@ 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,13 +423,12 @@ 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 17132917ba5d..5464a56a7886 100644 --- a/packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js +++ b/packages/engine/Source/DataSources/StaticOutlineGeometryBatch.js @@ -51,13 +51,16 @@ 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); + } + }) ); } }; @@ -155,16 +158,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) || @@ -182,7 +185,7 @@ Batch.prototype.update = function (time) { if (show !== currentShow) { attributes.show = ShowGeometryInstanceAttribute.toValue( show, - attributes.show, + attributes.show ); } @@ -193,24 +196,22 @@ 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 + ); } } @@ -220,16 +221,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 ); } } @@ -263,7 +264,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]; } @@ -422,7 +423,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 e071a4c571e4..8fb83fe4f720 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 d4012b1d34f5..329d1b136a2f 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 80e81e17f5e7..7813010f98c4 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,29 +106,32 @@ 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 @@ -149,8 +152,7 @@ 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 925d95376251..f6325bc8a148 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 0a0ef6d2527d..a4ab53537a23 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 a700d1e01f34..3d0b9d900c83 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 a205426a14c6..45c01e0cd742 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), + this._fillProperty.getValue(time) + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time + ); + const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition( + distanceDisplayCondition ); - 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,10 +146,11 @@ WallGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) { this._outlineColorProperty, time, Color.BLACK, - scratchColor, + scratchColor + ); + const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue( + time ); - const distanceDisplayCondition = - this._distanceDisplayConditionProperty.getValue(time); return new GeometryInstance({ id: entity, @@ -159,13 +160,12 @@ 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 247669354a38..05653c9225bf 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 82b45b5d95b4..689757dba97b 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 3a0eff321c2b..64b85afee4bc 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,11 +1273,7 @@ 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)) ); } @@ -1330,7 +1326,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); @@ -1341,18 +1337,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); @@ -1399,16 +1395,16 @@ function processMaterial(state, materialProperty, style) { kmlDoc, "outerColor", outlineColor, - gxNamespace, - ), + gxNamespace + ) ); style.appendChild( createBasicElementWithText( kmlDoc, "outerWidth", outlineWidth, - gxNamespace, - ), + gxNamespace + ) ); break; case "Stripe": @@ -1419,7 +1415,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") ); } } @@ -1430,7 +1426,7 @@ function getAltitudeMode(state, heightReferenceProperty) { const heightReference = valueGetter.get( heightReferenceProperty, - HeightReference.NONE, + HeightReference.NONE ); let altitudeModeText; switch (heightReference) { @@ -1459,10 +1455,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 - }`, + }` ); } @@ -1473,7 +1469,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 fdfaf462b70f..987275ff8e59 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 73e1ab26b623..14ce1744eb8f 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 53e028aca287..41628876c8b7 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 27c1be7a8aa6..641e8cc5c967 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 2bd832ddea92..696db4f2934f 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 8bb6d0da2ace..1459080510a5 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 abfe2a5dd59a..6cbfb90c1e41 100644 --- a/packages/engine/Source/Renderer/Context.js +++ b/packages/engine/Source/Renderer/Context.js @@ -51,7 +51,7 @@ function Context(canvas, options) { } = defaultValue(options, {}); // Override select WebGL defaults - webglOptions.alpha = defaultValue(webglOptions.alpha, false); // WebGL default is true + webglOptions.alpha = defaultValue(webglOptions.alpha, true); // WebGL default is true webglOptions.stencil = defaultValue(webglOptions.stencil, true); // WebGL default is false webglOptions.powerPreference = defaultValue( webglOptions.powerPreference, @@ -1308,6 +1308,7 @@ function beginDraw( bindFramebuffer(context, framebuffer); applyRenderState(context, renderState, passState, false); shaderProgram._bind(); + context._maxFrameTextureUnitIndex = Math.max( context._maxFrameTextureUnitIndex, shaderProgram.maximumTextureUnitIndex, @@ -1382,6 +1383,7 @@ function continueDraw(context, drawCommand, shaderProgram, uniformMap) { } else { count = va.numberOfVertices; } + if (instanceCount === 0) { context._gl.drawArrays(primitiveType, offset, count); } else { diff --git a/packages/engine/Source/Renderer/CubeMap.js b/packages/engine/Source/Renderer/CubeMap.js index 89400a607846..ccd7879ad7d9 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 9fc7daf2533e..75cc8c710f41 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 acdcaccc317e..0309f3bc0439 100644 --- a/packages/engine/Source/Renderer/DrawCommand.js +++ b/packages/engine/Source/Renderer/DrawCommand.js @@ -29,7 +29,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; @@ -52,18 +52,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 36745f24cb5d..36f67ee3d312 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() ); } @@ -123,12 +123,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 ( @@ -136,7 +136,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." ); } @@ -148,17 +148,17 @@ function Framebuffer(options) { defined(options.depthStencilRenderbuffer); 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'); @@ -167,15 +167,13 @@ function Framebuffer(options) { if (defined(options.colorTextures)) { const textures = options.colorTextures; - const length = - (this._colorTextures.length = - this._activeColorAttachments.length = - textures.length); + const 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 +184,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 +192,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 +200,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,15 +214,13 @@ function Framebuffer(options) { if (defined(options.colorRenderbuffers)) { const renderbuffers = options.colorRenderbuffers; - const length = - (this._colorRenderbuffers.length = - this._activeColorAttachments.length = - renderbuffers.length); + const 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'); @@ -244,7 +240,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'); @@ -271,7 +267,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'); @@ -382,7 +378,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'); @@ -398,7 +394,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 d9e5a8a64493..bd67073f5eb8 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'); @@ -419,7 +419,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 7990b5f1abfa..93a2083f7635 100644 --- a/packages/engine/Source/Renderer/MultisampleFramebuffer.js +++ b/packages/engine/Source/Renderer/MultisampleFramebuffer.js @@ -53,13 +53,13 @@ function MultisampleFramebuffer(options) { 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." ); } 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." ); } @@ -95,7 +95,7 @@ MultisampleFramebuffer.prototype.getColorFramebuffer = function () { */ MultisampleFramebuffer.prototype.blitFramebuffers = function ( context, - blitStencil, + blitStencil ) { this._renderFramebuffer.bindRead(); this._colorFramebuffer.bindDraw(); @@ -117,7 +117,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/Pass.js b/packages/engine/Source/Renderer/Pass.js index bdfe61dc1564..6a8a37d3d213 100644 --- a/packages/engine/Source/Renderer/Pass.js +++ b/packages/engine/Source/Renderer/Pass.js @@ -21,7 +21,8 @@ const Pass = { OPAQUE: 7, TRANSLUCENT: 8, VOXELS: 9, - OVERLAY: 10, - NUMBER_OF_PASSES: 11, + GAUSSIAN_SPLATS: 10, + OVERLAY: 11, + NUMBER_OF_PASSES: 12, }; export default Object.freeze(Pass); diff --git a/packages/engine/Source/Renderer/RenderState.js b/packages/engine/Source/Renderer/RenderState.js index a4a7d8f863d3..e83838745c35 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 74f672159e20..ab875c2878db 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 0fc66755101e..a25e30fd2803 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 95fd920d5769..6fd79ab0098e 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 dc297dd86f44..95268dd6b8b3 100644 --- a/packages/engine/Source/Renderer/ShaderCache.js +++ b/packages/engine/Source/Renderer/ShaderCache.js @@ -112,10 +112,12 @@ 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, @@ -149,7 +151,7 @@ ShaderCache.prototype.getShaderProgram = function (options) { ShaderCache.prototype.replaceDerivedShaderProgram = function ( shaderProgram, keyword, - options, + options ) { const cachedShader = shaderProgram._cachedShader; const derivedKeyword = keyword + cachedShader.keyword; @@ -167,7 +169,7 @@ ShaderCache.prototype.replaceDerivedShaderProgram = function ( ShaderCache.prototype.getDerivedShaderProgram = function ( shaderProgram, - keyword, + keyword ) { const cachedShader = shaderProgram._cachedShader; const derivedKeyword = keyword + cachedShader.keyword; @@ -182,7 +184,7 @@ ShaderCache.prototype.getDerivedShaderProgram = function ( ShaderCache.prototype.createDerivedShaderProgram = function ( shaderProgram, keyword, - options, + options ) { const cachedShader = shaderProgram._cachedShader; const derivedKeyword = keyword + cachedShader.keyword; @@ -205,10 +207,12 @@ 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 00d1ca4ea39b..3da6656486ee 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 e8e180328599..d9df800dc518 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 7f72eac0afd5..66d253e19ef5 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,46 +170,45 @@ 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. @@ -217,7 +216,7 @@ function combineShader(shaderSource, isFragmentShader, context) { if (defined(pickColorQualifier)) { combinedSources = ShaderSource.createPickFragmentShaderSource( combinedSources, - pickColorQualifier, + pickColorQualifier ); } @@ -281,7 +280,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) @@ -339,7 +338,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'); @@ -423,8 +422,9 @@ 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 b4b1259d5001..4f1be8c7acab 100644 --- a/packages/engine/Source/Renderer/Texture.js +++ b/packages/engine/Source/Renderer/Texture.js @@ -339,9 +339,17 @@ function loadBufferSource(texture, source) { pixelDatatype, width, ); + + let glErr; gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); + glErr = gl.getError(); + if (glErr !== 0) { + console.log( + `pixelStorei err ${glErr}, format ${pixelFormat} internalFormat ${internalFormat}`, + ); + } let arrayBufferView = source.arrayBufferView; if (flipY) { @@ -364,6 +372,12 @@ function loadBufferSource(texture, source) { PixelDatatype.toWebGLConstant(pixelDatatype, context), arrayBufferView, ); + glErr = gl.getError(); + if (glErr !== 0) { + console.log( + `texImage2D err ${glErr}, format ${pixelFormat} internalFormat ${internalFormat}`, + ); + } if (defined(source.mipLevels)) { let mipWidth = width; diff --git a/packages/engine/Source/Renderer/UniformState.js b/packages/engine/Source/Renderer/UniformState.js index 3c3fa7c42754..9cf580df9af6 100644 --- a/packages/engine/Source/Renderer/UniformState.js +++ b/packages/engine/Source/Renderer/UniformState.js @@ -1227,26 +1227,25 @@ 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 ); } @@ -1259,29 +1258,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 @@ -1290,7 +1289,7 @@ function setCamera(uniformState, camera) { uniformState._eyeEllipsoidCurvature = ellipsoid.getLocalCurvature( surfacePosition, - uniformState._eyeEllipsoidCurvature, + uniformState._eyeEllipsoidCurvature ); } @@ -1299,14 +1298,13 @@ 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); @@ -1314,15 +1312,14 @@ 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); @@ -1331,7 +1328,7 @@ function setSunAndMoonDirections(uniformState, frameState) { const ellipsoid = projection.ellipsoid; const sunCartographic = ellipsoid.cartesianToCartographic( uniformState._sunPositionWC, - sunCartographicScratch, + sunCartographicScratch ); projection.project(sunCartographic, uniformState._sunPositionColumbusView); } @@ -1377,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; @@ -1432,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 ); } @@ -1455,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); @@ -1481,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 = @@ -1503,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; @@ -1525,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 @@ -1550,8 +1547,7 @@ 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; } @@ -1567,13 +1563,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; } @@ -1590,7 +1586,7 @@ function cleanInverseProjection(uniformState) { ) { Matrix4.inverse( uniformState._projection, - uniformState._inverseProjection, + uniformState._inverseProjection ); } else { Matrix4.clone(Matrix4.ZERO, uniformState._inverseProjection); @@ -1606,7 +1602,7 @@ function cleanModelView(uniformState) { Matrix4.multiplyTransformation( uniformState._view, uniformState._model, - uniformState._modelView, + uniformState._modelView ); } } @@ -1618,7 +1614,7 @@ function cleanModelView3D(uniformState) { Matrix4.multiplyTransformation( uniformState.view3D, uniformState._model, - uniformState._modelView3D, + uniformState._modelView3D ); } } @@ -1646,7 +1642,7 @@ function cleanViewProjection(uniformState) { Matrix4.multiply( uniformState._projection, uniformState._view, - uniformState._viewProjection, + uniformState._viewProjection ); } } @@ -1657,7 +1653,7 @@ function cleanInverseViewProjection(uniformState) { Matrix4.inverse( uniformState.viewProjection, - uniformState._inverseViewProjection, + uniformState._inverseViewProjection ); } } @@ -1669,7 +1665,7 @@ function cleanModelViewProjection(uniformState) { Matrix4.multiply( uniformState._projection, uniformState.modelView, - uniformState._modelViewProjection, + uniformState._modelViewProjection ); } } @@ -1705,7 +1701,7 @@ function cleanInverseModelViewProjection(uniformState) { Matrix4.inverse( uniformState.modelViewProjection, - uniformState._inverseModelViewProjection, + uniformState._inverseModelViewProjection ); } } @@ -1717,7 +1713,7 @@ function cleanModelViewProjectionRelativeToEye(uniformState) { Matrix4.multiply( uniformState._projection, uniformState.modelViewRelativeToEye, - uniformState._modelViewProjectionRelativeToEye, + uniformState._modelViewProjectionRelativeToEye ); } } @@ -1729,7 +1725,7 @@ function cleanModelViewInfiniteProjection(uniformState) { Matrix4.multiply( uniformState._infiniteProjection, uniformState.modelView, - uniformState._modelViewInfiniteProjection, + uniformState._modelViewInfiniteProjection ); } } @@ -1783,11 +1779,11 @@ function cleanEncodedCameraPositionMC(uniformState) { Matrix4.multiplyByPoint( uniformState.inverseModel, uniformState._cameraPosition, - cameraPositionMC, + cameraPositionMC ); EncodedCartesian3.fromCartesian( cameraPositionMC, - uniformState._encodedCameraPositionMC, + uniformState._encodedCameraPositionMC ); } } @@ -1808,7 +1804,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 @@ -1847,24 +1843,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. @@ -1910,7 +1906,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 a33cafc1068c..bdc2971f017a 100644 --- a/packages/engine/Source/Renderer/VertexArray.js +++ b/packages/engine/Source/Renderer/VertexArray.js @@ -11,6 +11,7 @@ import RuntimeError from "../Core/RuntimeError.js"; import Buffer from "./Buffer.js"; import BufferUsage from "./BufferUsage.js"; import ContextLimits from "./ContextLimits.js"; +import AttributeType from "../Scene/AttributeType.js"; function addAttribute(attributes, attribute, index, context) { const hasVertexBuffer = defined(attribute.vertexBuffer); @@ -25,7 +26,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 +37,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 +50,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 +68,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 +82,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 +96,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 +115,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 +342,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 +400,7 @@ function interleaveAttributes(attributes) { attributes[name].componentDatatype = ComponentDatatype.FLOAT; attributes[name].values = ComponentDatatype.createTypedArray( ComponentDatatype.FLOAT, - attributes[name].values, + attributes[name].values ); } } @@ -414,7 +415,7 @@ function interleaveAttributes(attributes) { for (j = 1; j < namesLength; ++j) { const currentNumberOfVertices = computeNumberOfVertices( - attributes[names[j]], + attributes[names[j]] ); if (currentNumberOfVertices !== numberOfVertices) { @@ -424,7 +425,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 +455,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 +472,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 +583,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; @@ -648,26 +649,59 @@ VertexArray.fromGeometry = function (options) { componentDatatype = ComponentDatatype.FLOAT; } + let attrProps = {}; vertexBuffer = undefined; if (defined(attribute.values)) { vertexBuffer = Buffer.createVertexBuffer({ context: context, typedArray: ComponentDatatype.createTypedArray( componentDatatype, - attribute.values, + attribute.values ), usage: bufferUsage, }); + + attrProps = { + index: attributeLocations[name], + vertexBuffer: vertexBuffer, + value: attribute.value, + componentDatatype: componentDatatype, + componentsPerAttribute: attribute.componentsPerAttribute, + normalize: attribute.normalize, + }; + } + + //if we already have a typedArray lets use it + if (defined(attribute.typedArray)) { + vertexBuffer = Buffer.createVertexBuffer({ + context: context, + typedArray: attribute.typedArray, + usage: bufferUsage, + }); + + attrProps = { + index: attributeLocations[name], + vertexBuffer: vertexBuffer, + value: undefined, + componentDatatype: componentDatatype, + componentsPerAttribute: AttributeType.getNumberOfComponents( + attribute.type + ), + normalize: attribute.normalized, + instanceDivisor: attribute.instanceDivisor, + }; } - vaAttributes.push({ - index: attributeLocations[name], - vertexBuffer: vertexBuffer, - value: attribute.value, - componentDatatype: componentDatatype, - componentsPerAttribute: attribute.componentsPerAttribute, - normalize: attribute.normalize, - }); + vaAttributes.push(attrProps); + + // vaAttributes.push({ + // index: attributeLocations[name], + // vertexBuffer: vertexBuffer, + // value: attribute.value, + // componentDatatype: componentDatatype, + // componentsPerAttribute: attribute.componentsPerAttribute, + // normalize: attribute.normalize, + // }); } } } diff --git a/packages/engine/Source/Renderer/VertexArrayFacade.js b/packages/engine/Source/Renderer/VertexArrayFacade.js index 4779a69c140d..752269a0262c 100644 --- a/packages/engine/Source/Renderer/VertexArrayFacade.js +++ b/packages/engine/Source/Renderer/VertexArrayFacade.js @@ -64,8 +64,9 @@ 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; @@ -77,7 +78,7 @@ function VertexArrayFacade(context, attributes, sizeInVertices, instanced) { arrayBuffer: undefined, arrayViews: VertexArrayFacade._createArrayViews( attributesForUsage, - vertexSizeInBytes, + vertexSizeInBytes ), }; @@ -108,7 +109,7 @@ VertexArrayFacade._verifyAttributes = function (attributes) { componentsPerAttribute: attribute.componentsPerAttribute, componentDatatype: defaultValue( attribute.componentDatatype, - ComponentDatatype.FLOAT, + ComponentDatatype.FLOAT ), normalize: defaultValue(attribute.normalize, false), @@ -126,20 +127,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'); @@ -153,7 +154,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'); @@ -262,7 +263,7 @@ VertexArrayFacade._resize = function (buffer, size) { view.view = ComponentDatatype.createArrayBufferView( view.componentDatatype, arrayBuffer, - view.offsetInBytes, + view.offsetInBytes ); } @@ -357,7 +358,7 @@ VertexArrayFacade.prototype.commit = function (indexBuffer) { attributes, buffer, offset, - this._instanced, + this._instanced ); } @@ -413,7 +414,7 @@ VertexArrayFacade._appendAttributes = function ( attributes, buffer, vertexBufferOffset, - instanced, + instanced ) { const arrayViews = buffer.arrayViews; const length = arrayViews.length; @@ -436,17 +437,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'); @@ -468,7 +469,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 912c11d9d2e8..95392ac20661 100644 --- a/packages/engine/Source/Renderer/createUniform.js +++ b/packages/engine/Source/Renderer/createUniform.js @@ -26,6 +26,8 @@ function createUniform(gl, activeUniform, uniformName, location) { case gl.SAMPLER_2D: case gl.SAMPLER_CUBE: return new UniformSampler(gl, activeUniform, uniformName, location); + case gl.UNSIGNED_INT_SAMPLER_2D: + return new UniformSampler(gl, activeUniform, uniformName, location); case gl.INT: case gl.BOOL: return new UniformInt(gl, activeUniform, uniformName, location); diff --git a/packages/engine/Source/Renderer/createUniformArray.js b/packages/engine/Source/Renderer/createUniformArray.js index 9b38fca15b6b..0c9268a1d7b5 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 df0d795a7b84..e30fcab815f6 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 06312734bb27..693da0a51896 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 d1b97d8f6365..282ecdfebd6d 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.`; @@ -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,14 +392,15 @@ 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); } @@ -409,14 +410,15 @@ 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); } @@ -426,14 +428,15 @@ 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); } @@ -461,8 +464,11 @@ 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 = { @@ -746,7 +752,7 @@ ArcGisMapServerImageryProvider.fromUrl = async function (url, options) { ArcGisMapServerImageryProvider.prototype.getTileCredits = function ( x, y, - level, + level ) { return this._tileCredits; }; @@ -765,11 +771,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) ); }; @@ -792,7 +798,7 @@ ArcGisMapServerImageryProvider.prototype.pickFeatures = function ( y, level, longitude, - latitude, + latitude ) { if (!this.enablePickFeatures) { return undefined; @@ -809,7 +815,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; @@ -865,7 +871,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(); @@ -873,8 +879,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 8da3a11e501d..0227be51c324 100644 --- a/packages/engine/Source/Scene/ArcGisMapService.js +++ b/packages/engine/Source/Scene/ArcGisMapService.js @@ -32,7 +32,8 @@ 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", }); /** @@ -42,7 +43,8 @@ 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", }); /** @@ -52,7 +54,8 @@ 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 9d2032cff6e1..7d7e08f3d606 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,8 +325,9 @@ 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 6ce33ac5aeb9..3f5c6ab5f8d0 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 c5021877894e..6d06e6161538 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 d8d0580b6a2b..a24e541c86e8 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 49927f76aa5d..4c1b2c4f1d90 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,17 +371,16 @@ 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); }; @@ -479,33 +478,32 @@ 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); - } - return 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 defined(result); }; @@ -530,17 +528,16 @@ 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 8cc3484b95b8..7b43f8cee30d 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 d06129800960..13b1148cc920 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,10 +271,8 @@ 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; @@ -427,7 +425,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." ); } } @@ -473,7 +471,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." ); } } @@ -483,7 +481,7 @@ Object.defineProperties(Billboard.prototype, { if (!NearFarScalar.equals(translucencyByDistance, value)) { this._translucencyByDistance = NearFarScalar.clone( value, - translucencyByDistance, + translucencyByDistance ); makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX); } @@ -523,7 +521,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." ); } } @@ -533,7 +531,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); } @@ -857,14 +855,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); } @@ -887,7 +885,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." ); } } @@ -1016,7 +1014,7 @@ Object.defineProperties(Billboard.prototype, { set: function (value) { this._actualClampedPosition = Cartesian3.clone( value, - this._actualClampedPosition, + this._actualClampedPosition ); makeDirty(this, POSITION_INDEX); }, @@ -1125,7 +1123,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'); @@ -1168,7 +1166,7 @@ Billboard._updateClamping = function (collection, owner) { function updateFunction(clampedPosition) { const updatedClampedPosition = ellipsoid.cartographicToCartesian( clampedPosition, - owner._clampedPosition, + owner._clampedPosition ); if (isHeightReferenceRelative(owner._heightReference)) { @@ -1176,7 +1174,7 @@ Billboard._updateClamping = function (collection, owner) { clampedPosition.height += position.height; ellipsoid.cartographicToCartesian( clampedPosition, - updatedClampedPosition, + updatedClampedPosition ); } else { updatedClampedPosition.x += position.height; @@ -1189,7 +1187,7 @@ Billboard._updateClamping = function (collection, owner) { owner._removeCallbackFunc = scene.updateHeight( position, updateFunction, - owner._heightReference, + owner._heightReference ); Cartographic.clone(position, scratchCartographic); @@ -1390,7 +1388,7 @@ Billboard._computeActualPosition = function ( billboard, position, frameState, - modelMatrix, + modelMatrix ) { if (defined(billboard._clampedPosition)) { if (frameState.mode !== billboard._mode) { @@ -1404,7 +1402,7 @@ Billboard._computeActualPosition = function ( Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3); return SceneTransforms.computeActualEllipsoidPosition( frameState, - tempCartesian3, + tempCartesian3 ); }; @@ -1417,13 +1415,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 @@ -1431,7 +1429,7 @@ Billboard._computeScreenSpacePosition = function ( scene, positionWorld, eyeOffset, - result, + result ); if (!defined(positionWC)) { return undefined; @@ -1471,7 +1469,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)) { @@ -1503,7 +1501,7 @@ Billboard.prototype.computeScreenSpacePosition = function (scene, result) { this._eyeOffset, scratchPixelOffset, scene, - result, + result ); return windowCoordinates; }; @@ -1520,7 +1518,7 @@ Billboard.prototype.computeScreenSpacePosition = function (scene, result) { Billboard.getScreenSpaceBoundingBox = function ( billboard, screenSpacePosition, - result, + result ) { let width = billboard.width; let height = billboard.height; @@ -1585,15 +1583,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) @@ -1603,7 +1601,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 54da7f40943d..b4d2ffdf7ab9 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,17 +1006,21 @@ 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; @@ -1028,28 +1032,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 ); } } @@ -1059,7 +1063,7 @@ function writeCompressedAttrib1( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute1]; @@ -1103,11 +1107,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); @@ -1145,7 +1149,7 @@ function writeCompressedAttrib2( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute2]; @@ -1179,15 +1183,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; @@ -1224,7 +1228,7 @@ function writeEyeOffset( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { let i; const writer = vafWriters[attributeLocations.eyeOffset]; @@ -1239,7 +1243,7 @@ function writeEyeOffset( billboardCollection._maxEyeOffset, Math.abs(eyeOffset.x), Math.abs(eyeOffset.y), - Math.abs(eyeOffsetZ), + Math.abs(eyeOffsetZ) ); if (billboardCollection._instanced) { @@ -1261,8 +1265,9 @@ 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); @@ -1280,7 +1285,7 @@ function writeScaleByDistance( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { let i; const writer = vafWriters[attributeLocations.scaleByDistance]; @@ -1320,7 +1325,7 @@ function writePixelOffsetScaleByDistance( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { let i; const writer = vafWriters[attributeLocations.pixelOffsetScaleByDistance]; @@ -1360,7 +1365,7 @@ function writeCompressedAttribute3( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { let i; const writer = vafWriters[attributeLocations.compressedAttribute3]; @@ -1417,13 +1422,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; @@ -1451,7 +1456,7 @@ function writeTextureCoordinateBoundsOrLabelTranslate( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { if (isHeightReferenceClamp(billboard.heightReference)) { const scene = billboardCollection._scene; @@ -1529,7 +1534,7 @@ function writeBatchId( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { if (!defined(billboardCollection._batchTable)) { return; @@ -1556,7 +1561,7 @@ function writeSDF( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { if (!billboardCollection._sdf) { return; @@ -1596,7 +1601,7 @@ function writeSplitDirection( frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ) { const writer = vafWriters[attributeLocations.splitDirection]; let direction = 0.0; @@ -1624,91 +1629,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 ); } @@ -1718,7 +1723,7 @@ function recomputeActualPositions( length, frameState, modelMatrix, - recomputeBoundingVolume, + recomputeBoundingVolume ) { let boundingVolume; if (frameState.mode === SceneMode.SCENE3D) { @@ -1736,7 +1741,7 @@ function recomputeActualPositions( billboard, position, frameState, - modelMatrix, + modelMatrix ); if (defined(actualPosition)) { billboard._setActualPosition(actualPosition); @@ -1782,7 +1787,7 @@ function updateMode(billboardCollection, frameState) { billboards.length, frameState, modelMatrix, - true, + true ); } } else if (mode === SceneMode.MORPHING) { @@ -1792,7 +1797,7 @@ function updateMode(billboardCollection, frameState) { billboards.length, frameState, modelMatrix, - true, + true ); } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) { recomputeActualPositions( @@ -1801,7 +1806,7 @@ function updateMode(billboardCollection, frameState) { billboardCollection._billboardsToUpdateIndex, frameState, modelMatrix, - false, + false ); } } @@ -1812,7 +1817,7 @@ function updateBoundingVolume(collection, frameState, boundingVolume) { pixelScale = frameState.camera.getPixelSize( boundingVolume, frameState.context.drawingBufferWidth, - frameState.context.drawingBufferHeight, + frameState.context.drawingBufferHeight ); } @@ -1931,7 +1936,7 @@ BillboardCollection.prototype.update = function (frameState) { this._buffersUsage, this._instanced, this._batchTable, - this._sdf, + this._sdf ); vafWriters = this._vaf.writers; @@ -1944,7 +1949,7 @@ BillboardCollection.prototype.update = function (frameState) { frameState, textureAtlasCoordinates, vafWriters, - billboard, + billboard ); } @@ -2079,7 +2084,7 @@ BillboardCollection.prototype.update = function (frameState) { BoundingSphere.transform( this._baseVolume, this.modelMatrix, - this._baseVolumeWC, + this._baseVolumeWC ); } @@ -2089,12 +2094,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); @@ -2182,11 +2187,11 @@ BillboardCollection.prototype.update = function (frameState) { vsSource = this._batchTable.getVertexShaderCallback( false, "a_batchId", - undefined, + undefined )(vsSource); fsSource = this._batchTable.getFragmentShaderCallback( false, - undefined, + undefined )(fsSource); } @@ -2337,12 +2342,9 @@ 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 26d600e1bc1b..8024cea285de 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 8bfb24ed38b6..a9adb87b3fd0 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 15e0eaf293d4..89eb3401a5a2 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 bc4075c8f827..fb5f572abb9c 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 f24e257cef63..6ed0e6a6cab2 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,16 +726,15 @@ 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 @@ -758,7 +757,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 @@ -767,11 +766,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); @@ -784,7 +783,7 @@ function updateMembers(camera) { camera._directionWC = Matrix4.multiplyByPointAsVector( transform, direction, - camera._directionWC, + camera._directionWC ); Cartesian3.normalize(camera._directionWC, camera._directionWC); } @@ -798,7 +797,7 @@ function updateMembers(camera) { camera._rightWC = Matrix4.multiplyByPointAsVector( transform, right, - camera._rightWC, + camera._rightWC ); Cartesian3.normalize(camera._rightWC, camera._rightWC); } @@ -999,7 +998,7 @@ Object.defineProperties(Camera.prototype, { const transform = Transforms.eastNorthUpToFixedFrame( this.positionWC, ellipsoid, - scratchHPRMatrix2, + scratchHPRMatrix2 ); this._setTransform(transform); @@ -1030,7 +1029,7 @@ Object.defineProperties(Camera.prototype, { const transform = Transforms.eastNorthUpToFixedFrame( this.positionWC, ellipsoid, - scratchHPRMatrix2, + scratchHPRMatrix2 ); this._setTransform(transform); @@ -1061,7 +1060,7 @@ Object.defineProperties(Camera.prototype, { const transform = Transforms.eastNorthUpToFixedFrame( this.positionWC, ellipsoid, - scratchHPRMatrix2, + scratchHPRMatrix2 ); this._setTransform(transform); @@ -1126,7 +1125,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 ( @@ -1135,7 +1134,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'); @@ -1153,7 +1152,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'); @@ -1218,7 +1217,7 @@ function calculateOrthographicFrustumWidth(camera) { ray, scene, true, - scratchRayIntersection, + scratchRayIntersection ); } @@ -1226,7 +1225,7 @@ function calculateOrthographicFrustumWidth(camera) { if (scene.pickPositionSupported) { depthIntersection = scene.pickPositionWorldCoordinates( mousePosition, - scratchDepthIntersection, + scratchDepthIntersection ); } @@ -1272,12 +1271,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); @@ -1286,7 +1285,7 @@ function setView3D(camera, position, hpr) { const rotQuat = Quaternion.fromHeadingPitchRoll( hpr, - scratchSetViewQuaternion, + scratchSetViewQuaternion ); const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3); @@ -1302,7 +1301,7 @@ function setView3D(camera, position, hpr) { function setViewCV(camera, position, hpr, convert) { const currentTransform = Matrix4.clone( camera.transform, - scratchSetViewTransform1, + scratchSetViewTransform1 ); camera._setTransform(Matrix4.IDENTITY); @@ -1311,7 +1310,7 @@ function setViewCV(camera, position, hpr, convert) { const projection = camera._projection; const cartographic = projection.ellipsoid.cartesianToCartographic( position, - scratchSetViewCartographic, + scratchSetViewCartographic ); position = projection.project(cartographic, scratchSetViewCartesian); } @@ -1321,7 +1320,7 @@ function setViewCV(camera, position, hpr, convert) { const rotQuat = Quaternion.fromHeadingPitchRoll( hpr, - scratchSetViewQuaternion, + scratchSetViewQuaternion ); const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3); @@ -1337,7 +1336,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); @@ -1346,7 +1345,7 @@ function setView2D(camera, position, hpr, convert) { const projection = camera._projection; const cartographic = projection.ellipsoid.cartesianToCartographic( position, - scratchSetViewCartographic, + scratchSetViewCartographic ); position = projection.project(cartographic, scratchSetViewCartesian); } @@ -1372,7 +1371,7 @@ function setView2D(camera, position, hpr, convert) { hpr.roll = 0.0; const rotQuat = Quaternion.fromHeadingPitchRoll( hpr, - scratchSetViewQuaternion, + scratchSetViewQuaternion ); const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3); @@ -1390,7 +1389,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); @@ -1399,11 +1398,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); @@ -1488,7 +1487,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; @@ -1503,12 +1502,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 @@ -1524,7 +1523,7 @@ Camera.prototype.setView = function (options) { this, destination, orientation, - scratchSetViewOptions.orientation, + scratchSetViewOptions.orientation ); } @@ -1564,7 +1563,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); @@ -1583,7 +1582,7 @@ Camera.prototype.flyHome = function (duration) { position = Cartesian3.multiplyByScalar( Cartesian3.normalize(position, position), 5.0 * maxRadii, - position, + position ); this.flyTo({ destination: position, @@ -1662,7 +1661,7 @@ Camera.prototype.worldToCameraCoordinatesVector = function (cartesian, result) { return Matrix4.multiplyByPointAsVector( this._actualInvTransform, cartesian, - result, + result ); }; @@ -1729,7 +1728,7 @@ Camera.prototype.cameraToWorldCoordinatesVector = function (cartesian, result) { return Matrix4.multiplyByPointAsVector( this._actualTransform, cartesian, - result, + result ); }; @@ -1977,7 +1976,7 @@ Camera.prototype.look = function (axis, angle) { const quaternion = Quaternion.fromAxisAngle( axis, -turnAngle, - lookScratchQuaternion, + lookScratchQuaternion ); const rotation = Matrix3.fromQuaternion(quaternion, lookScratchMatrix); @@ -2039,7 +2038,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); @@ -2088,24 +2087,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); @@ -2116,7 +2115,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) { @@ -2126,7 +2125,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)) { @@ -2183,7 +2182,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'); @@ -2295,7 +2294,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 ); } }; @@ -2350,7 +2349,7 @@ Camera.prototype.lookAt = function (target, offset) { const transform = Transforms.eastNorthUpToFixedFrame( target, ellipsoid, - scratchLookAtMatrix4, + scratchLookAtMatrix4 ); this.lookAtTransform(transform, offset); }; @@ -2364,29 +2363,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); @@ -2429,7 +2428,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'); @@ -2444,7 +2443,7 @@ Camera.prototype.lookAtTransform = function (transform, offset) { cartesianOffset = offsetFromHeadingPitchRange( offset.heading, offset.pitch, - offset.range, + offset.range ); } else { cartesianOffset = offset; @@ -2563,14 +2562,17 @@ 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; } @@ -2581,7 +2583,7 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { const center = ellipsoid.cartographicToCartesian( centerCartographic, - viewRectangle3DCenter, + viewRectangle3DCenter ); const cart = viewRectangle3DCartographic1; @@ -2589,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); @@ -2634,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; @@ -2671,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 @@ -2683,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) ); } } @@ -2709,7 +2711,7 @@ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) { return Cartesian3.add( center, Cartesian3.multiplyByScalar(direction, -d, viewRectangle3DEquator), - result, + result ); } @@ -2746,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; @@ -2931,7 +2933,7 @@ Camera.prototype.pickEllipsoid = function (windowPosition, ellipsoid, result) { this, windowPosition, this._projection, - result, + result ); } else { return undefined; @@ -2961,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); @@ -3017,7 +3019,7 @@ function getPickRayOrthographic(camera, windowPosition, result) { result.origin.z, result.origin.x, result.origin.y, - result.origin, + result.origin ); } @@ -3079,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); }; @@ -3102,7 +3104,7 @@ const scratchPixelSize = new Cartesian2(); Camera.prototype.getPixelSize = function ( boundingSphere, drawingBufferWidth, - drawingBufferHeight, + drawingBufferHeight ) { //>>includeStart('debug', pragmas.debug); if (!defined(boundingSphere)) { @@ -3122,7 +3124,7 @@ Camera.prototype.getPixelSize = function ( drawingBufferHeight, distance, this._scene.pixelRatio, - scratchPixelSize, + scratchPixelSize ); return Math.max(pixelSize.x, pixelSize.y); }; @@ -3133,7 +3135,7 @@ function createAnimationTemplateCV( center, maxX, maxY, - duration, + duration ) { const newPosition = Cartesian3.clone(position); @@ -3154,7 +3156,7 @@ function createAnimationTemplateCV( position, newPosition, value.time, - new Cartesian3(), + new Cartesian3() ); camera.worldToCameraCoordinatesPoint(interp, camera.position); } @@ -3182,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); @@ -3198,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; @@ -3224,7 +3226,7 @@ function createAnimationCV(camera, duration) { center, maxX, maxY, - duration, + duration ); } } @@ -3382,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 ); } @@ -3464,12 +3466,11 @@ 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 + ); } }; @@ -3505,7 +3506,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 = @@ -3557,7 +3558,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'); @@ -3614,7 +3615,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { const offset = adjustBoundingSphereOffset( this, boundingSphere, - options.offset, + options.offset ); let position; @@ -3622,13 +3623,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 ); } @@ -3638,7 +3639,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { const transform = Transforms.eastNorthUpToFixedFrame( boundingSphere.center, ellipsoid, - scratchflyToBoundingSphereTransform, + scratchflyToBoundingSphereTransform ); Matrix4.multiplyByPoint(transform, position, position); @@ -3649,29 +3650,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); } @@ -3679,7 +3680,7 @@ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) { const right = Cartesian3.cross( direction, up, - scratchflyToBoundingSphereRight, + scratchflyToBoundingSphereRight ); Cartesian3.cross(right, direction, up); Cartesian3.normalize(up, up); @@ -3722,7 +3723,7 @@ function computeHorizonQuad(camera, ellipsoid) { const q = Cartesian3.multiplyComponents( ellipsoid.oneOverRadii, p, - scratchCartesian3_1, + scratchCartesian3_1 ); const qMagnitude = Cartesian3.magnitude(q); @@ -3739,11 +3740,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 ); } @@ -3754,18 +3755,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. @@ -3802,7 +3803,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]); @@ -3810,7 +3811,7 @@ function addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) { } cartoArray[index] = ellipsoid.cartesianToCartographic( computedHorizonQuad[index], - cartoArray[index], + cartoArray[index] ); return 0; } @@ -3827,11 +3828,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) { @@ -3852,7 +3853,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 0, this, ellipsoid, - computedHorizonQuad, + computedHorizonQuad ); successfulPickCount += addToResult( 0, @@ -3860,7 +3861,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 1, this, ellipsoid, - computedHorizonQuad, + computedHorizonQuad ); successfulPickCount += addToResult( width, @@ -3868,7 +3869,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 2, this, ellipsoid, - computedHorizonQuad, + computedHorizonQuad ); successfulPickCount += addToResult( width, @@ -3876,7 +3877,7 @@ Camera.prototype.computeViewRectangle = function (ellipsoid, result) { 3, this, ellipsoid, - computedHorizonQuad, + computedHorizonQuad ); if (successfulPickCount < 2) { @@ -3907,7 +3908,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 24a0be753884..67bf50bb8fc3 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 3490f72f497f..6d6a1aa29a73 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 53e21c781f15..2d6a2d80974b 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,8 +1532,9 @@ 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 @@ -1542,7 +1543,7 @@ Cesium3DTile.prototype.visibility = function ( return cullingVolume.computeVisibilityWithPlaneMask( boundingVolume, - parentVisibilityPlaneMask, + parentVisibilityPlaneMask ); }; @@ -1578,7 +1579,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) { @@ -1588,8 +1589,9 @@ 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; @@ -1628,7 +1630,7 @@ Cesium3DTile.prototype.distanceToTileCenter = function (frameState) { const toCenter = Cartesian3.subtract( boundingVolume.center, frameState.camera.positionWC, - scratchToTileCenter, + scratchToTileCenter ); return Cartesian3.dot(frameState.camera.directionWC, toCenter); }; @@ -1692,7 +1694,7 @@ function createBoxFromTransformedRegion( region, transform, initialTransform, - result, + result ) { const rectangle = Rectangle.unpack(region, 0, scratchRectangle); const minimumHeight = region[4]; @@ -1703,7 +1705,7 @@ function createBoxFromTransformedRegion( minimumHeight, maximumHeight, Ellipsoid.WGS84, - scratchOrientedBoundingBox, + scratchOrientedBoundingBox ); let center = orientedBoundingBox.center; let halfAxes = orientedBoundingBox.halfAxes; @@ -1714,7 +1716,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); @@ -1744,7 +1746,7 @@ function createRegion(region, transform, initialTransform, result) { region, transform, initialTransform, - result, + result ); } @@ -1779,7 +1781,7 @@ function createSphere(sphere, transform, result) { sphere[0], sphere[1], sphere[2], - scratchCenter, + scratchCenter ); let radius = sphere[3]; @@ -1810,15 +1812,17 @@ 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; @@ -1830,7 +1834,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"] ); } @@ -1841,7 +1845,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( exaggerateBoundingBox( tileOrientedBoundingBox, this._verticalExaggeration, - this._verticalExaggerationRelativeHeight, + this._verticalExaggerationRelativeHeight ); } return tileOrientedBoundingBox; @@ -1851,7 +1855,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( region, transform, this._initialTransform, - result, + result ); if (this._verticalExaggeration === 1.0) { return tileBoundingVolume; @@ -1860,18 +1864,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); } @@ -1885,7 +1889,7 @@ Cesium3DTile.prototype.createBoundingVolume = function ( Ellipsoid.WGS84, this._verticalExaggeration, this._verticalExaggerationRelativeHeight, - scratchCenter, + scratchCenter ); const exaggeratedRadius = tileBoundingSphere.radius * this._verticalExaggeration; @@ -1894,12 +1898,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) ); /** @@ -1913,7 +1917,7 @@ const scratchExaggeratedCorners = Cartesian3.unpackArray( function exaggerateBoundingBox( tileOrientedBoundingBox, exaggeration, - exaggerationRelativeHeight, + exaggerationRelativeHeight ) { const exaggeratedCorners = tileOrientedBoundingBox.boundingVolume .computeCorners(scratchExaggeratedCorners) @@ -1923,16 +1927,16 @@ function exaggerateBoundingBox( Ellipsoid.WGS84, exaggeration, exaggerationRelativeHeight, - corner, - ), + corner + ) ); const exaggeratedBox = OrientedBoundingBox.fromPoints( exaggeratedCorners, - scratchOrientedBoundingBox, + scratchOrientedBoundingBox ); tileOrientedBoundingBox.update( exaggeratedBox.center, - exaggeratedBox.halfAxes, + exaggeratedBox.halfAxes ); } @@ -1945,17 +1949,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) && @@ -1981,20 +1985,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 ); } @@ -2053,11 +2057,12 @@ 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(); @@ -2065,16 +2070,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 ( @@ -2082,8 +2087,9 @@ 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 ( @@ -2308,7 +2314,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 ); } @@ -2346,7 +2352,7 @@ Cesium3DTile.prototype.updatePriority = function () { const preloadProgressiveResolutionDigitsCount = digitsForABoolean; const preloadProgressiveResolutionScale = Math.pow( 10, - preloadProgressiveResolutionLeftShift, + preloadProgressiveResolutionLeftShift ); const foveatedDeferLeftShift = @@ -2363,7 +2369,7 @@ Cesium3DTile.prototype.updatePriority = function () { let depthDigits = priorityNormalizeAndClamp( this._depth, minimumPriority.depth, - maximumPriority.depth, + maximumPriority.depth ); depthDigits = preferLeaves ? 1.0 - depthDigits : depthDigits; @@ -2375,17 +2381,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 @@ -2395,12 +2401,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 5bb9f4f3ac42..b9a678cdd8c5 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,16 +56,17 @@ function Cesium3DTileBatchTable( this._batchTableHierarchy = initializeHierarchy( this, batchTableJson, - batchTableBinary, + batchTableBinary ); const binaryProperties = getBinaryProperties( featuresLength, properties, - batchTableBinary, + batchTableBinary + ); + this._binaryPropertiesByteLength = countBinaryPropertyMemory( + binaryProperties ); - this._binaryPropertiesByteLength = - countBinaryPropertyMemory(binaryProperties); this._batchTableBinaryProperties = binaryProperties; this._content = content; @@ -138,7 +139,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; @@ -172,7 +173,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.` ); } @@ -182,7 +183,7 @@ function getBinaryProperties(featuresLength, properties, binaryBody) { const typedArray = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + byteOffset, - featuresLength, + featuresLength ); if (!defined(binaryProperties)) { @@ -219,7 +220,7 @@ function countBinaryPropertyMemory(binaryProperties) { Cesium3DTileBatchTable.getBinaryProperties = function ( featuresLength, batchTableJson, - batchTableBinary, + batchTableBinary ) { return getBinaryProperties(featuresLength, batchTableJson, batchTableBinary); }; @@ -268,7 +269,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) @@ -302,7 +303,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}` - - +").", + +")." ); } } @@ -377,7 +378,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) ); } @@ -389,7 +390,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; @@ -416,7 +417,7 @@ Cesium3DTileBatchTable.prototype.getProperty = function (batchId, name) { if (defined(this._batchTableHierarchy)) { const hierarchyProperty = this._batchTableHierarchy.getProperty( batchId, - name, + name ); if (defined(hierarchyProperty)) { return hierarchyProperty; @@ -490,7 +491,7 @@ function getGlslComputeSt(batchTable) { Cesium3DTileBatchTable.prototype.getVertexShaderCallback = function ( handleTranslucent, batchIdAttributeName, - diffuseAttributeOrUniformName, + diffuseAttributeOrUniformName ) { if (this.featuresLength === 0) { return; @@ -503,7 +504,7 @@ Cesium3DTileBatchTable.prototype.getVertexShaderCallback = function ( const renamedSource = modifyDiffuse( source, diffuseAttributeOrUniformName, - false, + false ); let newMain; @@ -635,7 +636,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); @@ -715,7 +716,7 @@ function modifyDiffuse(source, diffuseAttributeOrUniformName, applyHighlight) { Cesium3DTileBatchTable.prototype.getFragmentShaderCallback = function ( handleTranslucent, diffuseAttributeOrUniformName, - hasPremultipliedAlpha, + hasPremultipliedAlpha ) { if (this.featuresLength === 0) { return; @@ -783,44 +784,43 @@ Cesium3DTileBatchTable.prototype.getFragmentShaderCallback = function ( }; }; -Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = - function () { - if (this.featuresLength === 0) { - return; +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"; } - 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; - }; + 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 7c18fdb7a19f..281235e37778 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 037de779ad92..49d3dd06e1c8 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 a691d9ec1792..a503ba18fc1c 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 d4a5d1c9dafd..9e836942f74c 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 52ab3f469fbb..01158482ac53 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 5ebe368e10a0..ca169352f42f 100644 --- a/packages/engine/Source/Scene/Cesium3DTileStyle.js +++ b/packages/engine/Source/Scene/Cesium3DTileStyle.js @@ -73,6 +73,14 @@ function Cesium3DTileStyle(style) { this._labelVerticalOrigin = undefined; this._meta = undefined; + this._splatScale = undefined; + this._showGaussianSplatting = true; + + //gaussian splatting debugging + this._debugSplatSortAlgo = 0; + this._useTexturePipeline = true; + this._useWebAssembly = true; + this._colorShaderFunction = undefined; this._showShaderFunction = undefined; this._pointSizeShaderFunction = undefined; @@ -116,6 +124,9 @@ function setup(that, styleJson) { that.labelHorizontalOrigin = styleJson.labelHorizontalOrigin; that.labelVerticalOrigin = styleJson.labelVerticalOrigin; + that.splatScale = styleJson.splatScale; + that.showGaussianSplatting = styleJson.showGaussianSplatting; + const meta = {}; if (defined(styleJson.meta)) { const defines = styleJson.defines; @@ -1310,6 +1321,24 @@ Object.defineProperties(Cesium3DTileStyle.prototype, { this._meta = value; }, }, + + splatScale: { + get: function () { + return this._splatScale; + }, + set: function (value) { + this._splatScale = value; + }, + }, + + showGaussianSplatting: { + get: function () { + return this._showGaussianSplatting; + }, + set: function (value) { + this._showGaussianSplatting = value; + }, + }, }); /** diff --git a/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js b/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js index f473b19b96e7..a04084e840ca 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js +++ b/packages/engine/Source/Scene/Cesium3DTilesVoxelProvider.js @@ -138,8 +138,13 @@ 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; @@ -173,7 +178,7 @@ function getTileCount(metadata) { } return metadata.tileset.getPropertyBySemantic( - MetadataSemantic.TILESET_TILE_COUNT, + MetadataSemantic.TILESET_TILE_COUNT ); } @@ -186,7 +191,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" ); } @@ -223,12 +228,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" ); } @@ -258,7 +263,7 @@ function getBoxShape(box, tileTransform) { const obb = OrientedBoundingBox.unpack(box); const shapeTransform = Matrix4.fromRotationTranslation( obb.halfAxes, - obb.center, + obb.center ); return { @@ -274,7 +279,7 @@ function getCylinderShape(cylinder, tileTransform) { const obb = OrientedBoundingBox.unpack(cylinder); const shapeTransform = Matrix4.fromRotationTranslation( obb.halfAxes, - obb.center, + obb.center ); return { @@ -340,10 +345,11 @@ 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, }); @@ -355,7 +361,7 @@ async function getVoxelContent(implicitTileset, tileCoordinates) { voxelResource, preprocessed.jsonPayload, preprocessed.binaryPayload, - implicitTileset.metadataSchema, + implicitTileset.metadataSchema ); return voxelContent; @@ -375,7 +381,7 @@ async function getSubtreePromise(provider, subtreeCoord) { const subtreeRelative = implicitTileset.subtreeUriTemplate.getDerivedResource( { templateValues: subtreeCoord.getTemplateValues(), - }, + } ); const subtreeResource = implicitTileset.baseResource.getDerivedResource({ url: subtreeRelative.url, @@ -396,7 +402,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 f3dc6a272f1a..f15cae5d1367 100644 --- a/packages/engine/Source/Scene/Cesium3DTileset.js +++ b/packages/engine/Source/Scene/Cesium3DTileset.js @@ -861,6 +861,22 @@ function Cesium3DTileset(options) { */ this.showOutline = defaultValue(options.showOutline, true); + /** + * Whether to display Gaussing Splatting (will fall back to point cloud rendering if false) + * + * + * @type {boolean} + */ + this.showGaussianSplatting = defaultValue( + options.showGaussianSplatting, + true, + ); + + this._enableShowGaussianSplatting = defaultValue( + options.enableShowGaussianSplatting, + true, + ); + /** * The color to use when rendering outlines. * diff --git a/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js b/packages/engine/Source/Scene/Cesium3DTilesetBaseTraversal.js index bd48b939cdae..a3a012d04fae 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,15 +189,19 @@ 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(); @@ -245,8 +249,12 @@ 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); @@ -254,7 +262,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 7c09edcbfa41..d4a8a5015159 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 6378a5ebcf7d..ec01db34d542 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 ec92d7a2caeb..8c2df573bfb2 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 00130506cd9f..8645642a852f 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 eebcff5bc987..81e18c41e78c 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,17 +269,21 @@ 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(); @@ -360,11 +364,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 ed80f3fc67fd..a75adb2100b7 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 fd13b76d9d4a..57dea371ce94 100644 --- a/packages/engine/Source/Scene/Cesium3DTilesetTraversal.js +++ b/packages/engine/Source/Scene/Cesium3DTilesetTraversal.js @@ -165,8 +165,10 @@ function isOnScreenLongEnough(tile, frameState) { return true; } - const { positionWCDeltaMagnitude, positionWCDeltaMagnitudeLastFrame } = - frameState.camera; + const { + positionWCDeltaMagnitude, + positionWCDeltaMagnitudeLastFrame, + } = frameState.camera; const deltaMagnitude = positionWCDeltaMagnitude !== 0.0 ? positionWCDeltaMagnitude @@ -294,29 +296,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 e08fc9950fdd..170b01a83a9f 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,15 +485,14 @@ 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); @@ -522,7 +521,7 @@ function createShaderProgram(classificationPrimitive, frameState) { const shadowVolumeAppearance = new ShadowVolumeAppearance( cullFragmentsUsingExtents, planarExtents, - classificationPrimitive.appearance, + classificationPrimitive.appearance ); classificationPrimitive._spStencil = ShaderProgram.replaceCache({ @@ -543,7 +542,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vsPick, false, - frameState.mapProjection, + frameState.mapProjection ); classificationPrimitive._spPick = ShaderProgram.replaceCache({ @@ -559,7 +558,7 @@ function createShaderProgram(classificationPrimitive, frameState) { if (cullFragmentsUsingExtents) { let pickProgram2D = context.shaderCache.getDerivedShaderProgram( classificationPrimitive._spPick, - "2dPick", + "2dPick" ); if (!defined(pickProgram2D)) { const pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true); @@ -567,7 +566,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vsPick, true, - frameState.mapProjection, + frameState.mapProjection ); pickProgram2D = context.shaderCache.createDerivedShaderProgram( @@ -577,7 +576,7 @@ function createShaderProgram(classificationPrimitive, frameState) { vertexShaderSource: pickVS2D, fragmentShaderSource: pickFS2D, attributeLocations: attributeLocations, - }, + } ); } classificationPrimitive._spPick2D = pickProgram2D; @@ -611,7 +610,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vs, false, - frameState.mapProjection, + frameState.mapProjection ); classificationPrimitive._spColor = ShaderProgram.replaceCache({ @@ -628,7 +627,7 @@ function createShaderProgram(classificationPrimitive, frameState) { if (cullFragmentsUsingExtents) { let colorProgram2D = context.shaderCache.getDerivedShaderProgram( classificationPrimitive._spColor, - "2dColor", + "2dColor" ); if (!defined(colorProgram2D)) { const fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true); @@ -636,7 +635,7 @@ function createShaderProgram(classificationPrimitive, frameState) { [extrudedDefine], vs, true, - frameState.mapProjection, + frameState.mapProjection ); colorProgram2D = context.shaderCache.createDerivedShaderProgram( @@ -646,7 +645,7 @@ function createShaderProgram(classificationPrimitive, frameState) { vertexShaderSource: vsColorSource2D, fragmentShaderSource: fsColorSource2D, attributeLocations: attributeLocations, - }, + } ); } classificationPrimitive._spColor2D = colorProgram2D; @@ -663,7 +662,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { let derivedCommand; let vaIndex = 0; let uniformMap = primitive._batchTable.getUniformMapCallback()( - classificationPrimitive._uniformMap, + classificationPrimitive._uniformMap ); const needs2DShader = classificationPrimitive._needs2DShader; @@ -688,7 +687,7 @@ function createColorCommands(classificationPrimitive, colorCommands) { derivedCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset, + command.derivedCommands.tileset ); derivedCommand.renderState = classificationPrimitive._rsStencilDepthPass3DTiles; @@ -719,7 +718,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; @@ -729,7 +728,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; @@ -737,7 +736,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; @@ -753,7 +752,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; @@ -784,7 +783,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { let derivedCommand; let vaIndex = 0; const uniformMap = primitive._batchTable.getUniformMapCallback()( - classificationPrimitive._uniformMap, + classificationPrimitive._uniformMap ); const needs2DShader = classificationPrimitive._needs2DShader; @@ -819,7 +818,7 @@ function createPickCommands(classificationPrimitive, pickCommands) { // Derive for 3D Tiles classification derivedCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset, + command.derivedCommands.tileset ); derivedCommand.renderState = classificationPrimitive._rsStencilDepthPass3DTiles; @@ -848,7 +847,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; @@ -858,7 +857,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; @@ -866,7 +865,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; @@ -881,7 +880,7 @@ function createCommands( translucent, twoPasses, colorCommands, - pickCommands, + pickCommands ) { createColorCommands(classificationPrimitive, colorCommands); createPickCommands(classificationPrimitive, pickCommands); @@ -897,7 +896,7 @@ function updateAndQueueRenderCommand( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ) { command.modelMatrix = modelMatrix; command.boundingVolume = boundingVolume; @@ -912,7 +911,7 @@ function updateAndQueuePickCommand( frameState, modelMatrix, cull, - boundingVolume, + boundingVolume ) { command.modelMatrix = modelMatrix; command.boundingVolume = boundingVolume; @@ -929,7 +928,7 @@ function updateAndQueueCommands( modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ) { const primitive = classificationPrimitive._primitive; Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix); @@ -972,7 +971,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ); } if (queue3DTilesCommands) { @@ -983,7 +982,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ); } } @@ -1000,7 +999,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ); } } @@ -1019,7 +1018,7 @@ function updateAndQueueCommands( frameState, modelMatrix, cull, - boundingVolume, + boundingVolume ); } if (queue3DTilesCommands) { @@ -1029,7 +1028,7 @@ function updateAndQueueCommands( frameState, modelMatrix, cull, - boundingVolume, + boundingVolume ); } } @@ -1081,12 +1080,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; } @@ -1099,7 +1098,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'); @@ -1118,7 +1117,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" ); } @@ -1136,7 +1135,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 ( @@ -1145,7 +1144,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'); @@ -1174,7 +1173,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { if (defined(this._createBoundingVolumeFunction)) { primitiveOptions._createBoundingVolumeFunction = function ( frameState, - geometry, + geometry ) { that._createBoundingVolumeFunction(frameState, geometry); }; @@ -1184,14 +1183,14 @@ ClassificationPrimitive.prototype.update = function (frameState) { primitive, context, appearance, - twoPasses, + twoPasses ) { createRenderStates(that, context); }; primitiveOptions._createShaderProgramFunction = function ( primitive, frameState, - appearance, + appearance ) { createShaderProgram(that, frameState); }; @@ -1202,7 +1201,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { translucent, twoPasses, colorCommands, - pickCommands, + pickCommands ) { createCommands( that, @@ -1211,7 +1210,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { true, false, colorCommands, - pickCommands, + pickCommands ); }; @@ -1224,7 +1223,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ) { that._updateAndQueueCommandsFunction( primitive, @@ -1234,7 +1233,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ); }; } else { @@ -1246,7 +1245,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ) { updateAndQueueCommands( that, @@ -1256,7 +1255,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ); }; } @@ -1271,19 +1270,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)); } @@ -1297,7 +1296,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 ( @@ -1305,7 +1304,7 @@ ClassificationPrimitive.prototype.update = function (frameState) { appearance instanceof PerInstanceColorAppearance ) { throw new DeveloperError( - "PerInstanceColorAppearance requires color GeometryInstanceAttribute", + "PerInstanceColorAppearance requires color GeometryInstanceAttribute" ); } //>>includeEnd('debug'); @@ -1341,12 +1340,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 d1372aafba61..c9c9d84a3cfa 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,40 +619,42 @@ 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; - // 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; - } + 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; + } - 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. @@ -666,7 +668,7 @@ ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = ClippingPlaneCollection.setOwner = function ( clippingPlaneCollection, owner, - key, + key ) { // Don't destroy the ClippingPlaneCollection if it is already owned by newOwner if (clippingPlaneCollection === owner[key]) { @@ -678,7 +680,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'); @@ -712,7 +714,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 3b1886aa44b4..2191a4e458ce 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 b1638373703d..dd960d690fe4 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,11 +661,10 @@ 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, @@ -742,54 +741,56 @@ 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; - - let intersection = Intersect.OUTSIDE; - if (this.inverse) { - intersection = Intersect.INSIDE; - } +ClippingPolygonCollection.prototype.computeIntersectionWithBoundingVolume = function ( + tileBoundingVolume, + ellipsoid +) { + const polygons = this._polygons; + const length = polygons.length; - for (let i = 0; i < length; ++i) { - const polygon = polygons[i]; + let intersection = Intersect.OUTSIDE; + if (this.inverse) { + intersection = Intersect.INSIDE; + } - 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, - ); - } + for (let i = 0; i < length; ++i) { + const polygon = polygons[i]; - if (!defined(tileBoundingRectangle)) { - tileBoundingRectangle = Rectangle.fromBoundingSphere( - tileBoundingVolume.boundingSphere, - 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 + ); + } - const result = Rectangle.simpleIntersection( - tileBoundingRectangle, - polygonBoundingRectangle, - scratchRectangleIntersection, + if (!defined(tileBoundingRectangle)) { + tileBoundingRectangle = Rectangle.fromBoundingSphere( + tileBoundingVolume.boundingSphere, + ellipsoid, + scratchRectangleTile ); + } - if (defined(result)) { - intersection = Intersect.INTERSECTING; - } + const result = Rectangle.simpleIntersection( + tileBoundingRectangle, + polygonBoundingRectangle, + scratchRectangleIntersection + ); + + if (defined(result)) { + intersection = Intersect.INTERSECTING; } + } - return intersection; - }; + return intersection; +}; /** * Sets the owner for the input ClippingPolygonCollection if there wasn't another owner. @@ -803,7 +804,7 @@ ClippingPolygonCollection.prototype.computeIntersectionWithBoundingVolume = ClippingPolygonCollection.setOwner = function ( clippingPolygonsCollection, owner, - key, + key ) { // Don't destroy the ClippingPolygonCollection if it is already owned by newOwner if (clippingPolygonsCollection === owner[key]) { @@ -815,7 +816,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'); @@ -848,7 +849,7 @@ ClippingPolygonCollection.isSupported = function (scene) { ClippingPolygonCollection.getTextureResolution = function ( texture, pixelsNeeded, - result, + result ) { if (defined(texture)) { result.x = texture.width; @@ -878,7 +879,7 @@ ClippingPolygonCollection.getTextureResolution = function ( */ ClippingPolygonCollection.getClippingDistanceTextureResolution = function ( clippingPolygonCollection, - result, + result ) { const texture = clippingPolygonCollection.signedDistanceTexture; if (defined(texture)) { @@ -905,7 +906,7 @@ ClippingPolygonCollection.getClippingDistanceTextureResolution = function ( */ ClippingPolygonCollection.getClippingExtentsTextureResolution = function ( clippingPolygonCollection, - result, + result ) { const texture = clippingPolygonCollection.extentsTexture; if (defined(texture)) { @@ -917,7 +918,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 da168182e3ed..43af3d6266a7 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,7 +447,14 @@ 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]); @@ -706,7 +713,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 c9636bcda93a..02be6c08ac6c 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 b88e01cc2053..1bed27442ace 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 b09c9077ed3c..adc66fcd4ca7 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 c2716ce8780f..cda1a16f8fe5 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 bfde2ff7e4f3..d66dd964813f 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 f0d2b0fadfeb..098eea16a602 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 d5ad4a421f8a..414882b124a9 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 e95de9ccb8f6..899933f7c915 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 61214248993c..7ab16bb7738c 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 a45fe0c68ab6..234ae355b313 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 8d70e283ac6a..cc84a664f3f5 100644 --- a/packages/engine/Source/Scene/DerivedCommand.js +++ b/packages/engine/Source/Scene/DerivedCommand.js @@ -16,7 +16,7 @@ const discardRegex = /\bdiscard\b/; function getDepthOnlyShaderProgram(context, shaderProgram) { const cachedShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "depthOnly", + "depthOnly" ); if (defined(cachedShader)) { return cachedShader; @@ -64,7 +64,7 @@ function getDepthOnlyShaderProgram(context, shaderProgram) { vertexShaderSource: shaderProgram.vertexShaderSource, fragmentShaderSource: fs, attributeLocations: shaderProgram._attributeLocations, - }, + } ); } @@ -95,7 +95,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 @@ -111,17 +111,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 { @@ -145,7 +145,7 @@ function getLogDepthShaderProgram(context, shaderProgram) { const cachedShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "logDepth", + "logDepth" ); if (defined(cachedShader)) { return cachedShader; @@ -223,7 +223,7 @@ void main() vertexShaderSource: vs, fragmentShaderSource: fs, attributeLocations: attributeLocations, - }, + } ); } @@ -239,7 +239,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 { @@ -252,7 +252,7 @@ DerivedCommand.createLogDepthCommand = function (command, context, result) { function getPickShaderProgram(context, shaderProgram, pickId) { const cachedShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "pick", + "pick" ); if (defined(cachedShader)) { return cachedShader; @@ -315,7 +315,7 @@ DerivedCommand.createPickDerivedCommand = function ( scene, command, context, - result, + result ) { if (!defined(result)) { result = {}; @@ -330,11 +330,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 { @@ -438,7 +438,7 @@ function getGlslType(classProperty) { function getPickMetadataShaderProgram( context, shaderProgram, - pickedMetadataInfo, + pickedMetadataInfo ) { const schemaId = pickedMetadataInfo.schemaId; const className = pickedMetadataInfo.className; @@ -446,7 +446,7 @@ function getPickMetadataShaderProgram( const keyword = `pickMetadata-${schemaId}-${className}-${propertyName}`; const shader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - keyword, + keyword ); if (defined(shader)) { return shader; @@ -491,32 +491,32 @@ function getPickMetadataShaderProgram( replaceDefine( newDefines, MetadataPickingPipelineStage.METADATA_PICKING_VALUE_TYPE, - glslType, + glslType ); replaceDefine( newDefines, MetadataPickingPipelineStage.METADATA_PICKING_VALUE_STRING, - `metadata.${propertyName}`, + `metadata.${propertyName}` ); replaceDefine( newDefines, MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_X, - sourceValueStrings[0], + sourceValueStrings[0] ); replaceDefine( newDefines, MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_Y, - sourceValueStrings[1], + sourceValueStrings[1] ); replaceDefine( newDefines, MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_Z, - sourceValueStrings[2], + sourceValueStrings[2] ); replaceDefine( newDefines, MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_W, - sourceValueStrings[3], + sourceValueStrings[3] ); const newFragmentShaderSource = new ShaderSource({ @@ -530,7 +530,7 @@ function getPickMetadataShaderProgram( vertexShaderSource: shaderProgram.vertexShaderSource, fragmentShaderSource: newFragmentShaderSource, attributeLocations: shaderProgram._attributeLocations, - }, + } ); return newShader; } @@ -542,24 +542,24 @@ DerivedCommand.createPickMetadataDerivedCommand = function ( scene, command, context, - result, + result ) { if (!defined(result)) { result = {}; } result.pickMetadataCommand = DrawCommand.shallowClone( command, - result.pickMetadataCommand, + result.pickMetadataCommand ); result.pickMetadataCommand.shaderProgram = getPickMetadataShaderProgram( context, command.shaderProgram, - command.pickedMetadataInfo, + command.pickedMetadataInfo ); result.pickMetadataCommand.renderState = getPickRenderState( scene, - command.renderState, + command.renderState ); result.shaderProgramId = command.shaderProgram.id; @@ -569,7 +569,7 @@ DerivedCommand.createPickMetadataDerivedCommand = function ( function getHdrShaderProgram(context, shaderProgram) { const cachedShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - "HDR", + "HDR" ); if (defined(cachedShader)) { return cachedShader; @@ -603,7 +603,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 9cf5fc73a4e6..de950a3b0b1b 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 74a517504992..56f2eaf71514 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 ab7d70811787..82530a0463c4 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 f51ed1d2bcda..30e4aaf91e37 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 2479baefb211..0b5c4459da35 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 a87be1b0940a..2d413de4b39c 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 9dd4e4e6899a..877d45b44f05 100644 --- a/packages/engine/Source/Scene/Fog.js +++ b/packages/engine/Source/Scene/Fog.js @@ -54,15 +54,48 @@ 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. @@ -149,7 +182,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); @@ -161,7 +194,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 3e7f3ae5053a..68169a6c24f6 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/GaussianSplatSorter.js b/packages/engine/Source/Scene/GaussianSplatSorter.js new file mode 100644 index 000000000000..e80f48f6f93b --- /dev/null +++ b/packages/engine/Source/Scene/GaussianSplatSorter.js @@ -0,0 +1,77 @@ +import defined from "../Core/defined.js"; +import FeatureDetection from "../Core/FeatureDetection.js"; +import RuntimeError from "../Core/RuntimeError.js"; +import TaskProcessor from "../Core/TaskProcessor.js"; + +function GaussianSplatSorter() {} + +GaussianSplatSorter._maxSortingConcurrency = Math.max( + FeatureDetection.hardwareConcurrency - 1, + 1, +); + +GaussianSplatSorter._sorterTaskProcessor = undefined; +GaussianSplatSorter._taskProcessorReady = false; +GaussianSplatSorter._error = undefined; +GaussianSplatSorter._getSorterTaskProcessor = function () { + if (!defined(GaussianSplatSorter._sorterTaskProcessor)) { + const processor = new TaskProcessor( + "gaussianSplatSorter", + GaussianSplatSorter._maxSortingConcurrency, + ); + processor + .initWebAssemblyModule({ + wasmBinaryFile: "ThirdParty/cesiumjs_gsplat_utils_bg.wasm", + }) + .then(function (result) { + if (result) { + GaussianSplatSorter._taskProcessorReady = true; + } else { + GaussianSplatSorter._error = new RuntimeError( + "Gaussian splat sorter could not be initialized.", + ); + } + }) + .catch((error) => { + GaussianSplatSorter._error = error; + }); + GaussianSplatSorter._sorterTaskProcessor = processor; + } + + return GaussianSplatSorter._sorterTaskProcessor; +}; + +GaussianSplatSorter.radixSort = function (parameters) { + const sorterTaskProcessor = GaussianSplatSorter._getSorterTaskProcessor(); + if (defined(GaussianSplatSorter._error)) { + throw GaussianSplatSorter._error; + } + + if (!GaussianSplatSorter._taskProcessorReady) { + return; + } + + return sorterTaskProcessor.scheduleTask(parameters, [ + parameters.primitive.attributes, + parameters.primitive.modelView, + parameters.primitive.count, + parameters.sortType, + ]); +}; + +GaussianSplatSorter.radixSortIndexes = function (parameters) { + const sorterTaskProcessor = GaussianSplatSorter._getSorterTaskProcessor(); + if (defined(GaussianSplatSorter._error)) { + throw GaussianSplatSorter._error; + } + + if (!GaussianSplatSorter._taskProcessorReady) { + return; + } + + return sorterTaskProcessor.scheduleTask(parameters, [ + parameters.primitive.positions.buffer, + ]); +}; + +export default GaussianSplatSorter; diff --git a/packages/engine/Source/Scene/Geometry3DTileContent.js b/packages/engine/Source/Scene/Geometry3DTileContent.js index 17685da7cd65..d89a278eb4b1 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 0d9b392bae22..6150c25d6cd3 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,8 +364,7 @@ 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 ca2c6a611be9..db02bc0f922f 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,24 +740,23 @@ 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. @@ -767,7 +766,7 @@ Globe.prototype.pickWorldCoordinates = function ( const boundingSphereIntersection = IntersectionTests.raySphere( ray, boundingVolume, - scratchSphereIntersectionResult, + scratchSphereIntersectionResult ); if (defined(boundingSphereIntersection)) { sphereIntersections.push(surfaceTile); @@ -784,7 +783,7 @@ Globe.prototype.pickWorldCoordinates = function ( scene.mode, scene.mapProjection, cullBackFaces, - result, + result ); if (defined(intersection)) { break; @@ -906,13 +905,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. @@ -920,7 +919,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 @@ -937,7 +936,7 @@ Globe.prototype.getHeight = function (cartographic) { const vectorToMinimumPoint = Cartesian3.multiplyByScalar( surfaceNormal, Math.abs(magnitude) + 1, - scratchGetHeightIntersection, + scratchGetHeightIntersection ); Cartesian3.subtract(cartesian, vectorToMinimumPoint, ray.origin); } @@ -947,7 +946,7 @@ Globe.prototype.getHeight = function (cartographic) { undefined, projection, false, - scratchGetHeightIntersection, + scratchGetHeightIntersection ); if (!defined(intersection)) { return undefined; @@ -955,7 +954,7 @@ Globe.prototype.getHeight = function (cartographic) { return ellipsoid.cartesianToCartographic( intersection, - scratchGetHeightCartographic, + scratchGetHeightCartographic ).height; }; @@ -1038,15 +1037,12 @@ 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; @@ -1058,8 +1054,7 @@ 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 6058642edb36..5b2508f5832f 100644 --- a/packages/engine/Source/Scene/GlobeDepth.js +++ b/packages/engine/Source/Scene/GlobeDepth.js @@ -93,7 +93,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { const useScissorTest = !BoundingRectangle.equals( viewport, - passState.viewport, + passState.viewport ); let updateScissor = useScissorTest !== globeDepth._useScissorTest; globeDepth._useScissorTest = useScissorTest; @@ -103,7 +103,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { ) { globeDepth._scissorRectangle = BoundingRectangle.clone( passState.viewport, - globeDepth._scissorRectangle, + globeDepth._scissorRectangle ); updateScissor = true; } @@ -161,7 +161,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - }, + } ); } @@ -179,7 +179,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - }, + } ); } @@ -195,7 +195,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - }, + } ); } @@ -213,7 +213,7 @@ function updateCopyCommands(globeDepth, context, width, height, passState) { }, }, owner: globeDepth, - }, + } ); } @@ -250,7 +250,7 @@ GlobeDepth.prototype.update = function ( viewport, numSamples, hdr, - clearGlobeDepth, + clearGlobeDepth ) { const { width, height } = viewport; @@ -268,7 +268,7 @@ GlobeDepth.prototype.update = function ( width, height, numSamples, - pixelDatatype, + pixelDatatype ); } this._copyDepthFramebuffer.update(context, width, height); @@ -296,8 +296,7 @@ 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(); } }; @@ -311,7 +310,7 @@ GlobeDepth.prototype.executeCopyDepth = function (context, passState) { GlobeDepth.prototype.executeUpdateDepth = function ( context, passState, - depthTexture, + depthTexture ) { const depthTextureToCopy = defined(depthTexture) ? depthTexture @@ -383,23 +382,19 @@ GlobeDepth.prototype.destroy = function () { this._updateDepthFramebuffer.destroy(); 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 c89625c50ffa..b0c4b8063b4f 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,8 +398,7 @@ 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 += `\ @@ -410,8 +409,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\ @@ -427,8 +426,7 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) { } } - computeDayColor += - "\ + computeDayColor += "\ return color;\n\ }"; @@ -450,7 +448,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 0571b9e363ee..c1c7ab20dd52 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 6aeab65e44af..385a602b7307 100644 --- a/packages/engine/Source/Scene/GlobeSurfaceTileProvider.js +++ b/packages/engine/Source/Scene/GlobeSurfaceTileProvider.js @@ -129,26 +129,22 @@ 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; @@ -216,7 +212,7 @@ Object.defineProperties(GlobeSurfaceTileProvider.prototype, { this._baseColor = value; this._firstPassInitialColor = Cartesian4.fromColor( value, - this._firstPassInitialColor, + this._firstPassInitialColor ); }, }, @@ -481,7 +477,7 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) { this, this._quadtree._tilesToRender, frameState, - this._vertexArraysToDestroy, + this._vertexArraysToDestroy ); } @@ -538,7 +534,7 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) { addDrawCommandsForTile(this, tile, frameState); frameState.minimumTerrainHeight = Math.min( frameState.minimumTerrainHeight, - tileBoundingRegion.minimumHeight, + tileBoundingRegion.minimumHeight ); } } @@ -551,7 +547,7 @@ function pushCommand(command, frameState) { globeTranslucencyState.pushDerivedCommands( command, isBlendCommand, - frameState, + frameState ); } else { frameState.commandList.push(command); @@ -585,7 +581,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; @@ -625,7 +621,7 @@ GlobeSurfaceTileProvider.prototype.loadTile = function (frameState, tile) { this._imageryLayers, this.quadtree, this._vertexArraysToDestroy, - terrainOnly, + terrainOnly ); surfaceTile = tile.data; @@ -647,7 +643,7 @@ GlobeSurfaceTileProvider.prototype.loadTile = function (frameState, tile) { this._imageryLayers, this.quadtree, this._vertexArraysToDestroy, - terrainOnly, + terrainOnly ); } } @@ -665,7 +661,7 @@ function clipRectangleAntimeridian(tileRectangle, cartographicLimitRectangle) { } const splitRectangle = Rectangle.clone( cartographicLimitRectangle, - splitCartographicLimitRectangleScratch, + splitCartographicLimitRectangleScratch ); const tileCenter = Rectangle.center(tileRectangle, rectangleCenterScratch); if (tileCenter.longitude > 0.0) { @@ -702,7 +698,7 @@ function isUndergroundVisible(tileProvider, frameState) { if ( !Rectangle.equals( tileProvider.cartographicLimitRectangle, - Rectangle.MAX_VALUE, + Rectangle.MAX_VALUE ) ) { return true; @@ -727,7 +723,7 @@ function isUndergroundVisible(tileProvider, frameState) { GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( tile, frameState, - occluders, + occluders ) { const distance = this.computeDistanceToTile(tile, frameState); tile._distance = distance; @@ -760,12 +756,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; @@ -781,13 +777,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 ( @@ -797,7 +793,7 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( boundingVolume = BoundingSphere.union( tileBoundingRegion.boundingSphere, boundingVolume, - boundingVolume, + boundingVolume ); } } @@ -808,8 +804,9 @@ 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; @@ -818,10 +815,9 @@ 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. @@ -859,7 +855,7 @@ GlobeSurfaceTileProvider.prototype.computeTileVisibility = function ( if ( occluders.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid( occludeePointInScaledSpace, - tileBoundingRegion.minimumHeight, + tileBoundingRegion.minimumHeight ) ) { return visibility; @@ -887,7 +883,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; }; @@ -905,7 +901,7 @@ const canRenderTraversalStack = []; */ GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function ( tile, - frameState, + frameState ) { const surfaceTile = tile.data; @@ -961,7 +957,7 @@ GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function ( tile.southwestChild, tile.southeastChild, tile.northwestChild, - tile.northeastChild, + tile.northeastChild ); while (stack.length > 0) { @@ -1011,7 +1007,7 @@ GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function ( descendant.southwestChild, descendant.southeastChild, descendant.northwestChild, - descendant.northeastChild, + descendant.northeastChild ); } } @@ -1029,7 +1025,7 @@ const tileDirectionScratch = new Cartesian3(); */ GlobeSurfaceTileProvider.prototype.computeTileLoadPriority = function ( tile, - frameState, + frameState ) { const surfaceTile = tile.data; if (surfaceTile === undefined) { @@ -1046,7 +1042,7 @@ GlobeSurfaceTileProvider.prototype.computeTileLoadPriority = function ( const tileDirection = Cartesian3.subtract( obb.center, cameraPosition, - tileDirectionScratch, + tileDirectionScratch ); const magnitude = Cartesian3.magnitude(tileDirection); if (magnitude < CesiumMath.EPSILON5) { @@ -1078,7 +1074,7 @@ const northeastScratch = new Cartesian3(); */ GlobeSurfaceTileProvider.prototype.showTileThisFrame = function ( tile, - frameState, + frameState ) { let readyTextureCount = 0; const tileImageryCollection = tile.data.imagery; @@ -1125,7 +1121,7 @@ function computeOccludeePoint( rectangle, minimumHeight, maximumHeight, - result, + result ) { const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid; const ellipsoid = ellipsoidalOccluder.ellipsoid; @@ -1136,35 +1132,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 ); } @@ -1178,7 +1174,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 @@ -1319,12 +1315,12 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { tileBoundingRegion.minimumHeight = VerticalExaggeration.getHeight( tileBoundingRegion.minimumHeight, exaggeration, - exaggerationRelativeHeight, + exaggerationRelativeHeight ); tileBoundingRegion.maximumHeight = VerticalExaggeration.getHeight( tileBoundingRegion.maximumHeight, exaggeration, - exaggerationRelativeHeight, + exaggerationRelativeHeight ); } @@ -1332,15 +1328,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 @@ -1351,7 +1347,7 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { tile.rectangle, tileBoundingRegion.minimumHeight, tileBoundingRegion.maximumHeight, - surfaceTile.occludeePointInScaledSpace, + surfaceTile.occludeePointInScaledSpace ); } } @@ -1371,7 +1367,7 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) { tile.rectangle, tileBoundingRegion.minimumHeight, tileBoundingRegion.maximumHeight, - surfaceTile.occludeePointInScaledSpace, + surfaceTile.occludeePointInScaledSpace ); } } @@ -1442,7 +1438,7 @@ function getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) { tileImagery = tileImageryCollection[i]; imagery = defaultValue( tileImagery.readyImagery, - tileImagery.loadingImagery, + tileImagery.loadingImagery ); if (imagery.imageryLayer === layer) { startIndex = i; @@ -1462,7 +1458,7 @@ function getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) { return !layer._createTileImagerySkeletons( tile, terrainProvider, - endIndex, + endIndex ); } @@ -1508,7 +1504,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) { @@ -1534,14 +1530,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; @@ -1618,7 +1614,7 @@ GlobeSurfaceTileProvider.prototype._onLayerRemoved = function (layer, index) { GlobeSurfaceTileProvider.prototype._onLayerMoved = function ( layer, newIndex, - oldIndex, + oldIndex ) { this._layerOrderChanged = true; this._imageryLayersUpdatedEvent.raiseEvent(); @@ -1627,7 +1623,7 @@ GlobeSurfaceTileProvider.prototype._onLayerMoved = function ( GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden = function ( layer, index, - show, + show ) { if (show) { this._onLayerAdded(layer, index); @@ -1690,7 +1686,7 @@ function createTileUniformMap(frameState, globeSurfaceTileProvider) { const centerEye = Matrix4.multiplyByPoint( viewMatrix, this.properties.rtc, - centerEyeScratch, + centerEyeScratch ); Matrix4.setTranslation(viewMatrix, centerEye, modifiedModelViewScratch); return modifiedModelViewScratch; @@ -1701,17 +1697,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; }, @@ -1795,13 +1791,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 () { @@ -1959,7 +1955,7 @@ function createWireframeVertexArrayIfNecessary(context, provider, tile) { surfaceTile.wireframeVertexArray = createWireframeVertexArray( context, vertexArray, - mesh, + mesh ); surfaceTile.wireframeVertexArray.mesh = mesh; } @@ -1991,7 +1987,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({ @@ -2039,12 +2035,13 @@ 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; @@ -2061,12 +2058,13 @@ 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; @@ -2168,11 +2166,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) && @@ -2271,11 +2269,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; @@ -2316,8 +2314,9 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { southLatitude = tile.rectangle.south; northLatitude = tile.rectangle.north; - southMercatorY = - WebMercatorProjection.geodeticLatitudeToMercatorAngle(southLatitude); + southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( + southLatitude + ); oneOverMercatorHeight = 1.0 / @@ -2352,8 +2351,7 @@ 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; @@ -2392,7 +2390,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { for (let i = 0; i < drawCommandsLength; ++i) { tileProvider._uniformMaps[i] = createTileUniformMap( frameState, - tileProvider, + tileProvider ); } } @@ -2474,14 +2472,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 ); } @@ -2490,7 +2488,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { undergroundColorAlphaByDistance.nearValue, undergroundColorAlphaByDistance.far, undergroundColorAlphaByDistance.farValue, - uniformMapProperties.undergroundColorAlphaByDistance, + uniformMapProperties.undergroundColorAlphaByDistance ); Color.clone(undergroundColor, uniformMapProperties.undergroundColor); @@ -2504,13 +2502,12 @@ 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); @@ -2519,29 +2516,26 @@ 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; @@ -2562,7 +2556,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { Cartesian4.clone( localizedCartographicLimitRectangle, - uniformMapProperties.localizedCartographicLimitRectangle, + uniformMapProperties.localizedCartographicLimitRectangle ); localizedTranslucencyRectangle.x = @@ -2580,7 +2574,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 @@ -2635,8 +2629,10 @@ 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; @@ -2710,21 +2706,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; @@ -2746,8 +2742,9 @@ 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 = @@ -2785,7 +2782,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { uniformMapProperties.waterMask = waterMaskTexture; Cartesian4.clone( waterMaskTranslationAndScale, - uniformMapProperties.waterMaskTranslationAndScale, + uniformMapProperties.waterMaskTranslationAndScale ); uniformMapProperties.minMaxHeight.x = encoding.minimumHeight; @@ -2799,7 +2796,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { if (clippingPlanesEnabled) { uniformMapProperties.clippingPlanesEdgeColor = Color.clone( clippingPlanes.edgeColor, - uniformMapProperties.clippingPlanesEdgeColor, + uniformMapProperties.clippingPlanesEdgeColor ); uniformMapProperties.clippingPlanesEdgeWidth = clippingPlanes.edgeWidth; } @@ -2836,7 +2833,7 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) { } command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram( - surfaceShaderSetOptions, + surfaceShaderSetOptions ); command.castShadows = castShadows; command.receiveShadows = receiveShadows; @@ -2866,30 +2863,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 1b31e1768eb4..d81eca651829 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 c97297854ab7..7aea7f86d402 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 c26d7da41d68..b855ae167092 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,8 +718,7 @@ function createDerivedCommandPacks() { new DerivedCommandPack({ pass: Pass.TRANSLUCENT, pickOnly: false, - getShaderProgramFunction: - getTranslucentFrontFaceManualDepthTestShaderProgram, + getShaderProgramFunction: getTranslucentFrontFaceManualDepthTestShaderProgram, getRenderStateFunction: getTranslucentFrontFaceRenderState, getUniformMapFunction: getTranslucencyUniformMap, }), @@ -727,8 +726,7 @@ function createDerivedCommandPacks() { new DerivedCommandPack({ pass: Pass.TRANSLUCENT, pickOnly: false, - getShaderProgramFunction: - getTranslucentBackFaceManualDepthTestShaderProgram, + getShaderProgramFunction: getTranslucentBackFaceManualDepthTestShaderProgram, getRenderStateFunction: getTranslucentBackFaceRenderState, getUniformMapFunction: getTranslucencyUniformMap, }), @@ -756,7 +754,7 @@ const derivedCommandPacks = new Array(derivedCommandsMaximumLength); GlobeTranslucencyState.prototype.updateDerivedCommands = function ( command, - frameState, + frameState ) { const derivedCommandTypes = this._derivedCommandTypesToUpdate; const derivedCommandsLength = this._derivedCommandsToUpdateLength; @@ -777,7 +775,7 @@ GlobeTranslucencyState.prototype.updateDerivedCommands = function ( derivedCommandTypes, derivedCommandNames, derivedCommandPacks, - frameState, + frameState ); }; @@ -788,7 +786,7 @@ function updateDerivedCommands( derivedCommandTypes, derivedCommandNames, derivedCommandPacks, - frameState, + frameState ) { let derivedCommandsObject = command.derivedCommands.globeTranslucency; const derivedCommandsDirty = state._derivedCommandsDirty; @@ -809,15 +807,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 = @@ -868,15 +866,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 = @@ -906,7 +904,7 @@ function updateDerivedCommands( command.uniformMap, derivedUniformMap, derivedUniformMapDirty, - derivedCommandPack.getUniformMapFunction, + derivedCommandPack.getUniformMapFunction ); derivedCommand.shaderProgram = getDerivedShaderProgram( frameState.context, @@ -914,14 +912,14 @@ function updateDerivedCommands( derivedShaderProgram, derivedShaderProgramDirty, derivedCommandPack.getShaderProgramFunction, - derivedCommandName, + derivedCommandName ); derivedCommand.renderState = getDerivedRenderState( command.renderState, derivedRenderState, derivedRenderStateDirty, derivedCommandPack.getRenderStateFunction, - derivedCommandPack.renderStateCache, + derivedCommandPack.renderStateCache ); } } @@ -930,7 +928,7 @@ function updateDerivedCommands( GlobeTranslucencyState.prototype.pushDerivedCommands = function ( command, isBlendCommand, - frameState, + frameState ) { const picking = frameState.passes.pick || frameState.passes.pickVoxel; if (picking && isBlendCommand) { @@ -969,7 +967,7 @@ function executeCommandsMatchingType( executeCommandFunction, scene, passState, - types, + types ) { for (let i = 0; i < commandsLength; ++i) { const command = commands[i]; @@ -985,7 +983,7 @@ function executeCommands( commandsLength, executeCommandFunction, scene, - passState, + passState ) { for (let i = 0; i < commandsLength; ++i) { executeCommandFunction(commands[i], scene, passState); @@ -1007,7 +1005,7 @@ GlobeTranslucencyState.prototype.executeGlobeCommands = function ( executeCommandFunction, globeTranslucencyFramebuffer, scene, - passState, + passState ) { const context = scene.context; const globeCommands = frustumCommands.commands[Pass.GLOBE]; @@ -1027,7 +1025,7 @@ GlobeTranslucencyState.prototype.executeGlobeCommands = function ( executeCommandFunction, scene, passState, - opaqueTypes, + opaqueTypes ); }; @@ -1036,7 +1034,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( executeCommandFunction, globeTranslucencyFramebuffer, scene, - passState, + passState ) { const { context } = scene; const { uniformState } = context; @@ -1062,7 +1060,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( classificationCommandsLength, executeCommandFunction, scene, - passState, + passState ); } @@ -1086,14 +1084,14 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( executeCommandFunction, scene, 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 ); uniformState.globeDepthTexture = packedDepthTexture; } @@ -1104,7 +1102,7 @@ GlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function ( classificationCommandsLength, executeCommandFunction, scene, - passState, + passState ); // Unset temporary state diff --git a/packages/engine/Source/Scene/GltfBufferViewLoader.js b/packages/engine/Source/Scene/GltfBufferViewLoader.js index b53275b5e3c0..714d3166bae7 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 5a46f8e43535..de52c8412095 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 5f6b7dc3daac..97405b1dedaa 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 d853d90d73dc..b3485f565aeb 100644 --- a/packages/engine/Source/Scene/GltfLoader.js +++ b/packages/engine/Source/Scene/GltfLoader.js @@ -211,6 +211,7 @@ function GltfLoader(options) { loadPrimitiveOutline = true, loadForClassification = false, renameBatchIdSemantic = false, + loadGaussianSplatting = true, } = options; //>>includeStart('debug', pragmas.debug); @@ -235,6 +236,7 @@ function GltfLoader(options) { this._loadPrimitiveOutline = loadPrimitiveOutline; this._loadForClassification = loadForClassification; this._renameBatchIdSemantic = renameBatchIdSemantic; + this._loadGaussianSplatting = loadGaussianSplatting; // When loading EXT_feature_metadata, the feature tables and textures // are now stored as arrays like the newer EXT_structural_metadata extension. @@ -508,7 +510,7 @@ function postProcessGeometry(loader, context) { const loadPlan = loadPlans[i]; loadPlan.postProcess(context); - if (loadPlan.needsOutlines) { + if (loadPlan.needsOutlines || loadPlan.needsGaussianSplats) { // The glTF loader takes ownership of any buffers generated in the // post-process stage since they were created after the geometry loaders // finished. This way they can be destroyed when the loader is destroyed. @@ -1028,7 +1030,10 @@ function createAttribute(gltf, accessorId, name, semantic, setIndex) { attribute.semantic === VertexAttributeSemantic.POSITION || attribute.semantic === VertexAttributeSemantic.NORMAL || attribute.semantic === VertexAttributeSemantic.TANGENT || - attribute.semantic === VertexAttributeSemantic.TEXCOORD; + attribute.semantic === VertexAttributeSemantic.TEXCOORD || + attribute.semantic === VertexAttributeSemantic.FEATURE_ID || + attribute.semantic === VertexAttributeSemantic.SCALE || + attribute.semantic === VertexAttributeSemantic.ROTATION; // In the glTF 2.0 spec, min and max are not affected by the normalized flag. // However, for KHR_mesh_quantization, min and max must be dequantized for @@ -1940,6 +1945,13 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) { ); } + const gaussianSplattingExtension = extensions.KHR_gaussian_splatting; + + if (loader._loadGaussianSplatting && defined(gaussianSplattingExtension)) { + needsPostProcessing = true; + primitivePlan.needsGaussianSplats = true; + } + const loadForClassification = loader._loadForClassification; const draco = extensions.KHR_draco_mesh_compression; diff --git a/packages/engine/Source/Scene/GltfStructuralMetadataLoader.js b/packages/engine/Source/Scene/GltfStructuralMetadataLoader.js index 964b000760be..b8b2d0b0b45b 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,10 +81,9 @@ 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, { @@ -213,7 +212,7 @@ function gatherUsedBufferViewIds(extension) { const propertyTable = propertyTables[i]; gatherBufferViewIdsFromProperties( propertyTable.properties, - bufferViewIdSet, + bufferViewIdSet ); } } @@ -242,11 +241,11 @@ async function loadBufferViews(structuralMetadataLoader) { let bufferViewIds; if (defined(structuralMetadataLoader._extension)) { bufferViewIds = gatherUsedBufferViewIds( - structuralMetadataLoader._extension, + structuralMetadataLoader._extension ); } else { bufferViewIds = gatherUsedBufferViewIdsLegacy( - structuralMetadataLoader._extensionLegacy, + structuralMetadataLoader._extensionLegacy ); } @@ -332,7 +331,7 @@ function loadTextures(structuralMetadataLoader) { textureIds = gatherUsedTextureIds(structuralMetadataLoader._extension); } else { textureIds = gatherUsedTextureIdsLegacy( - structuralMetadataLoader._extensionLegacy, + structuralMetadataLoader._extensionLegacy ); } @@ -368,7 +367,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 4c07eef67629..ce02ace44958 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 52f77e4505e1..52cc5e5dc4a8 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,16 +237,17 @@ 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, + dracoQuantization.range + ); + quantization.quantizedVolumeDimensions = MathType.unpack( + packedDimensions ); - quantization.quantizedVolumeDimensions = - MathType.unpack(packedDimensions); // Computing the step size const packedSteps = packedDimensions.map(function (dimension) { @@ -306,14 +307,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 60ee4a4d69f5..0d591ed2f649 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 c5d078f72421..427b851014c6 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 e3f6fd4497b0..f079d4681aae 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 c82b9e1dd263..2c1515751ac4 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,8 +511,9 @@ 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]; @@ -534,7 +535,7 @@ function createCommands( const derivedTilesetCommand = DrawCommand.shallowClone( command, - command.derivedCommands.tileset, + command.derivedCommands.tileset ); derivedTilesetCommand.renderState = groundPolylinePrimitive._renderState3DTiles; @@ -544,14 +545,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; @@ -559,7 +560,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; @@ -575,7 +576,7 @@ function updateAndQueueCommand( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ) { // Use derived appearance command for morph and 2D if (frameState.mode === SceneMode.MORPHING) { @@ -598,7 +599,7 @@ function updateAndQueueCommands( pickCommands, modelMatrix, cull, - debugShowBoundingVolume, + debugShowBoundingVolume ) { const primitive = groundPolylinePrimitive._primitive; @@ -640,7 +641,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ); } if (queue3DTilesCommands) { @@ -652,7 +653,7 @@ function updateAndQueueCommands( modelMatrix, cull, boundingVolume, - debugShowBoundingVolume, + debugShowBoundingVolume ); } } @@ -679,7 +680,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'); @@ -733,7 +734,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { geometryInstance.geometry._scene3DOnly = frameState.scene3DOnly; GroundPolylineGeometry.setProjectionAndEllipsoid( geometryInstance.geometry, - frameState.mapProjection, + frameState.mapProjection ); groundInstances[i] = new GeometryInstance({ @@ -750,7 +751,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { primitiveOptions._createShaderProgramFunction = function ( primitive, frameState, - appearance, + appearance ) { createShaderProgram(that, frameState, appearance); }; @@ -761,7 +762,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { translucent, twoPasses, colorCommands, - pickCommands, + pickCommands ) { createCommands( that, @@ -769,7 +770,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { material, translucent, colorCommands, - pickCommands, + pickCommands ); }; primitiveOptions._updateAndQueueCommandsFunction = function ( @@ -780,7 +781,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ) { updateAndQueueCommands( that, @@ -789,7 +790,7 @@ GroundPolylinePrimitive.prototype.update = function (frameState) { pickCommands, modelMatrix, cull, - debugShowBoundingVolume, + debugShowBoundingVolume ); }; @@ -801,7 +802,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." ); } @@ -834,12 +835,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 5a3d5ab85393..f67249322b8a 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,22 +807,20 @@ 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; @@ -836,7 +834,7 @@ GroundPrimitive.prototype.update = function (frameState) { geometry: instanceType.createShadowVolume( geometry, getComputeMinimumHeightFunction(this), - getComputeMaximumHeightFunction(this), + getComputeMaximumHeightFunction(this) ), attributes: attributes, id: instance.id, @@ -852,7 +850,7 @@ GroundPrimitive.prototype.update = function (frameState) { geometry: instanceType.createShadowVolume( geometry, getComputeMinimumHeightFunction(this), - getComputeMaximumHeightFunction(this), + getComputeMaximumHeightFunction(this) ), attributes: instance.attributes, id: instance.id, @@ -865,7 +863,7 @@ GroundPrimitive.prototype.update = function (frameState) { primitiveOptions._createBoundingVolumeFunction = function ( frameState, - geometry, + geometry ) { createBoundingVolume(that, frameState, geometry); }; @@ -877,7 +875,7 @@ GroundPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ) { updateAndQueueCommands( that, @@ -887,7 +885,7 @@ GroundPrimitive.prototype.update = function (frameState) { modelMatrix, cull, debugShowBoundingVolume, - twoPasses, + twoPasses ); }; @@ -940,7 +938,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 5308fdbc2435..66b2e3c3d8ff 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 89e87643ef26..c4cd9cd4578e 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 d72218c43a33..97cc846e792c 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,17 +93,18 @@ 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 33c040c23b95..dc4550e333fe 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 f68e4fc7c5b5..2d6e11210f14 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 0ae1061ea9b5..59378e374db5 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 d3311e42b031..fb8c548c0fb3 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 129d7ee3032d..6d33f74514bd 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 5b4a802dbc66..21783b9e4afc 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 22bb7a1cb856..90056bd425dd 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 f0b20cb95fe2..bd0226a03429 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,12 +203,11 @@ 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; }, }, @@ -357,14 +356,15 @@ 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,8 +418,7 @@ ImageBasedLighting.prototype.update = function (frameState) { defined(this._previousSphericalHarmonicCoefficients) !== defined(this._sphericalHarmonicCoefficients); - this._previousSphericalHarmonicCoefficients = - this._sphericalHarmonicCoefficients; + this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients; } this._shouldRegenerateShaders = @@ -427,8 +426,7 @@ 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 c71c37261072..c7ed8fb4fd0c 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 897686064402..a6579f3ee4e6 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,44 +893,46 @@ 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, + imageryBounds + ); + imageryTileXYToRectangle = imageryTilingScheme.tileXYToNativeRectangle.bind( + imageryTilingScheme ); - 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; @@ -949,7 +951,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( maxU = Math.min( 1.0, (clippedImageryRectangle.west - terrainRectangle.west) / - terrainRectangle.width, + terrainRectangle.width ); } @@ -961,7 +963,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( minV = Math.max( 0.0, (clippedImageryRectangle.north - terrainRectangle.south) / - terrainRectangle.height, + terrainRectangle.height ); } @@ -977,12 +979,12 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( imageryRectangle = imageryTileXYToRectangle( i, northwestTileCoordinates.y, - imageryLevel, + imageryLevel ); clippedImageryRectangle = Rectangle.simpleIntersection( imageryRectangle, imageryBounds, - clippedRectangleScratch, + clippedRectangleScratch ); if (!defined(clippedImageryRectangle)) { @@ -992,7 +994,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, @@ -1021,7 +1023,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( clippedImageryRectangle = Rectangle.simpleIntersection( imageryRectangle, imageryBounds, - clippedRectangleScratch, + clippedRectangleScratch ); if (!defined(clippedImageryRectangle)) { @@ -1031,7 +1033,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, @@ -1052,7 +1054,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( surfaceTile.imagery.splice( insertionPoint, 0, - new TileImagery(imagery, texCoordsRectangle, useWebMercatorT), + new TileImagery(imagery, texCoordsRectangle, useWebMercatorT) ); ++insertionPoint; } @@ -1074,7 +1076,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function ( */ ImageryLayer.prototype._calculateTextureTranslationAndScale = function ( tile, - tileImagery, + tileImagery ) { let imageryRectangle = tileImagery.readyImagery.rectangle; let terrainRectangle = tile.rectangle; @@ -1084,11 +1086,11 @@ ImageryLayer.prototype._calculateTextureTranslationAndScale = function ( tileImagery.readyImagery.imageryLayer.imageryProvider.tilingScheme; imageryRectangle = tilingScheme.rectangleToNativeRectangle( imageryRectangle, - imageryBoundsScratch, + imageryBoundsScratch ); terrainRectangle = tilingScheme.rectangleToNativeRectangle( terrainRectangle, - terrainRectangleScratch, + terrainRectangleScratch ); } @@ -1102,7 +1104,7 @@ ImageryLayer.prototype._calculateTextureTranslationAndScale = function ( (scaleY * (terrainRectangle.south - imageryRectangle.south)) / terrainHeight, scaleX, - scaleY, + scaleY ); }; @@ -1153,7 +1155,7 @@ ImageryLayer.prototype._requestImagery = function (imagery) { imagery.x, imagery.y, imagery.level, - e, + e ); if (that._requestImageError.retry) { doRequest(); @@ -1172,7 +1174,7 @@ ImageryLayer.prototype._requestImagery = function (imagery) { imagery.x, imagery.y, imagery.level, - request, + request ); if (!defined(imagePromise)) { @@ -1186,7 +1188,7 @@ ImageryLayer.prototype._requestImagery = function (imagery) { imagery.credits = imageryProvider.getTileCredits( imagery.x, imagery.y, - imagery.level, + imagery.level ); } @@ -1270,7 +1272,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'); @@ -1292,7 +1294,7 @@ ImageryLayer.prototype._createTexture = function (context, imagery) { function getSamplerKey( minificationFilter, magnificationFilter, - maximumAnisotropy, + maximumAnisotropy ) { return `${minificationFilter}:${magnificationFilter}:${maximumAnisotropy}`; } @@ -1316,12 +1318,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)) { @@ -1344,7 +1346,7 @@ ImageryLayer.prototype._finalizeReprojectTexture = function (context, texture) { const nonMipmapSamplerKey = getSamplerKey( minificationFilter, magnificationFilter, - 0, + 0 ); let nonMipmapSamplers = context.cache.imageryLayerNonMipmapSamplers; if (!defined(nonMipmapSamplers)) { @@ -1377,7 +1379,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; @@ -1462,7 +1464,7 @@ ImageryLayer.prototype.getImageryFromCache = function ( x, y, level, - imageryRectangle, + imageryRectangle ) { const cacheKey = getImageryCacheKey(x, y, level); let imagery = this._imageryCache[cacheKey]; @@ -1696,7 +1698,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 3c2769810b2c..bb3604729695 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,8 +436,9 @@ ImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) { return; } - const pickedLocation = - scene.ellipsoid.cartesianToCartographic(pickedPosition); + const pickedLocation = scene.ellipsoid.cartesianToCartographic( + pickedPosition + ); const imageryLayers = []; @@ -482,7 +483,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); @@ -490,8 +491,9 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function ( return; } - const pickedLocation = - scene.ellipsoid.cartesianToCartographic(pickedPosition); + const pickedLocation = scene.ellipsoid.cartesianToCartographic( + pickedPosition + ); const promises = []; const imageryLayers = []; @@ -506,7 +508,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function ( imagery.y, imagery.level, pickedLocation.longitude, - pickedLocation.latitude, + pickedLocation.latitude ); if (defined(promise)) { promises.push(promise); @@ -550,7 +552,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 99980d2ab054..0ce99360f846 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,27 +85,28 @@ 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>"; - - return html; } + html += "</table>"; - this.description = describe(properties); - }; + return html; + } + + this.description = describe(properties); +}; export default ImageryLayerFeatureInfo; diff --git a/packages/engine/Source/Scene/ImageryProvider.js b/packages/engine/Source/Scene/ImageryProvider.js index 0a5d626732aa..0169ffdf0d44 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 9cd00a69a94b..96eebae51c1d 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,15 +445,16 @@ 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 @@ -464,8 +465,9 @@ 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; } @@ -487,7 +489,7 @@ function deriveChildTile( childIndex, parentIsPlaceholderTile, parentTile, - tileBounds, + tileBounds ); const contentJsons = []; @@ -505,7 +507,7 @@ function deriveChildTile( const contentBoundingVolume = getContentBoundingVolume( boundingVolume, - contentBounds, + contentBounds ); if (defined(contentBoundingVolume)) { @@ -520,7 +522,7 @@ function deriveChildTile( const childGeometricError = getGeometricError( tileMetadata, implicitTileset, - implicitCoordinates, + implicitCoordinates ); const tileJson = { @@ -555,7 +557,7 @@ function deriveChildTile( implicitContent, implicitTileset.baseResource, combinedTileJson, - parentTile, + parentTile ); childTile.implicitCoordinates = implicitCoordinates; @@ -611,13 +613,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 ); } } @@ -704,7 +706,7 @@ function getTileBoundingVolume( childIndex, parentIsPlaceholderTile, parentTile, - tileBounds, + tileBounds ) { let boundingVolume; @@ -719,7 +721,7 @@ function getTileBoundingVolume( implicitCoordinates, childIndex, defaultValue(parentIsPlaceholderTile, false), - parentTile, + parentTile ); } else { boundingVolume = tileBounds.boundingVolume; @@ -792,7 +794,7 @@ function deriveBoundingVolume( implicitCoordinates, childIndex, parentIsPlaceholderTile, - parentTile, + parentTile ) { const rootBoundingVolume = implicitTileset.boundingVolume; @@ -804,7 +806,7 @@ function deriveBoundingVolume( implicitCoordinates.level, implicitCoordinates.x, implicitCoordinates.y, - implicitCoordinates.z, + implicitCoordinates.z ); } @@ -814,7 +816,7 @@ function deriveBoundingVolume( implicitCoordinates.level, implicitCoordinates.x, implicitCoordinates.y, - implicitCoordinates.z, + implicitCoordinates.z ); return { @@ -827,7 +829,7 @@ function deriveBoundingVolume( implicitCoordinates.level, implicitCoordinates.x, implicitCoordinates.y, - implicitCoordinates.z, + implicitCoordinates.z ); return { @@ -863,7 +865,7 @@ function deriveBoundingVolumeS2( level, x, y, - z, + z ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.bool("parentIsPlaceholderTile", parentIsPlaceholderTile); @@ -982,7 +984,7 @@ function deriveBoundingBox(rootBox, level, x, y, z) { tileScale, tileScale, 1, - scratchScaleFactors, + scratchScaleFactors ); if (defined(z)) { @@ -994,7 +996,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); @@ -1084,15 +1086,16 @@ 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 @@ -1101,13 +1104,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, @@ -1124,7 +1127,7 @@ function makePlaceholderChildSubtree(content, parentTile, childIndex) { content, implicitTileset.baseResource, tileJson, - parentTile, + parentTile ); tile.implicitTileset = implicitTileset; tile.implicitCoordinates = implicitCoordinates; @@ -1167,7 +1170,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 c9af8ca5c6ae..9c664f9a5259 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 98e8456fab24..d00801aee969 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 d59d4516e34a..97133ffa17db 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,8 +1011,9 @@ 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; }; @@ -1025,7 +1026,7 @@ ImplicitSubtree.prototype.getTileIndex = function (implicitCoordinates) { * @private */ ImplicitSubtree.prototype.getChildSubtreeIndex = function ( - implicitCoordinates, + implicitCoordinates ) { const localLevel = implicitCoordinates.level - this._implicitCoordinates.level; @@ -1036,10 +1037,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; }; @@ -1127,7 +1128,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 584cf6f362da..252594d37bb8 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 887eea3d88a2..7814babf3cbc 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 44376c2ab311..efcc652fe3d4 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 e34f56b9c1e6..ce2e1fa187ef 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 b8d7da84e455..92922920a8ec 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 730bb803839e..5b1361bb734e 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 e9c03ef4b479..210b48ecbfd7 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 7196877768a9..4c43e93824a4 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 6bd01bac9ee8..1a723f3cf454 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,8 +896,7 @@ 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; @@ -991,8 +990,7 @@ 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 2a86db331cfc..23deb6d0880f 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 6eb2d07d5f3b..9cc2d9d24838 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 8673b8a1b06f..ba0e598d3c53 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,16 +1190,17 @@ 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 9dba04b55122..06280407f4f7 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 f91828ef0d3f..5173d98b3911 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,17 +76,18 @@ 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)); @@ -94,10 +95,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) { @@ -135,7 +136,7 @@ function Megatexture( */ this.regionCountPerMegatexture = new Cartesian2( regionCountPerMegatextureX, - regionCountPerMegatextureY, + regionCountPerMegatextureY ); /** @@ -144,7 +145,7 @@ function Megatexture( */ this.voxelCountPerRegion = new Cartesian2( voxelCountPerRegionX, - voxelCountPerRegionY, + voxelCountPerRegionY ); /** @@ -153,7 +154,7 @@ function Megatexture( */ this.sliceCountPerRegion = new Cartesian2( sliceCountPerRegionX, - sliceCountPerRegionY, + sliceCountPerRegionY ); /** @@ -162,7 +163,7 @@ function Megatexture( */ this.voxelSizeUv = new Cartesian2( 1.0 / textureDimension, - 1.0 / textureDimension, + 1.0 / textureDimension ); /** @@ -171,7 +172,7 @@ function Megatexture( */ this.sliceSizeUv = new Cartesian2( dimensions.x / textureDimension, - dimensions.y / textureDimension, + dimensions.y / textureDimension ); /** @@ -180,7 +181,7 @@ function Megatexture( */ this.regionSizeUv = new Cartesian2( voxelCountPerRegionX / textureDimension, - voxelCountPerRegionY / textureDimension, + voxelCountPerRegionY / textureDimension ); /** @@ -202,15 +203,16 @@ 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 ); /** @@ -349,7 +351,7 @@ Megatexture.getApproximateTextureMemoryByteLength = function ( tileCount, dimensions, channelCount, - componentType, + componentType ) { // TODO there's a lot of code duplicate with Megatexture constructor @@ -358,8 +360,9 @@ 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; @@ -371,7 +374,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 dec9b1393e3e..b21c05c06fd7 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 97dfa8ab4a11..ad7ab3afdfcd 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 af5188f6955a..750ab53dedb6 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 d4816ad6a9d1..ed23d940cd4e 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/MetadataPicking.js b/packages/engine/Source/Scene/MetadataPicking.js index 87f33a91d7d3..2af63b0af015 100644 --- a/packages/engine/Source/Scene/MetadataPicking.js +++ b/packages/engine/Source/Scene/MetadataPicking.js @@ -35,7 +35,7 @@ const MetadataPicking = {}; MetadataPicking.decodeRawMetadataValue = function ( componentType, dataView, - index, + index ) { switch (componentType) { case MetadataComponentType.INT8: @@ -81,13 +81,13 @@ MetadataPicking.decodeRawMetadataValue = function ( MetadataPicking.decodeRawMetadataValueComponent = function ( classProperty, dataView, - dataViewOffset, + dataViewOffset ) { const componentType = classProperty.componentType; const component = MetadataPicking.decodeRawMetadataValue( componentType, dataView, - dataViewOffset, + dataViewOffset ); if (classProperty.normalized) { return MetadataComponentType.normalize(component, componentType); @@ -118,11 +118,12 @@ MetadataPicking.decodeRawMetadataValueComponent = function ( MetadataPicking.decodeRawMetadataValueElement = function ( classProperty, dataView, - elementIndex, + elementIndex ) { const componentType = classProperty.componentType; - const componentSizeInBytes = - MetadataComponentType.getSizeInBytes(componentType); + const componentSizeInBytes = MetadataComponentType.getSizeInBytes( + componentType + ); const type = classProperty.type; const componentCount = MetadataType.getComponentCount(type); const elementSizeInBytes = componentSizeInBytes * componentCount; @@ -134,7 +135,7 @@ MetadataPicking.decodeRawMetadataValueElement = function ( const component = MetadataPicking.decodeRawMetadataValueComponent( classProperty, dataView, - offset, + offset ); result[i] = component; } @@ -144,7 +145,7 @@ MetadataPicking.decodeRawMetadataValueElement = function ( const result = MetadataPicking.decodeRawMetadataValueComponent( classProperty, dataView, - offset, + offset ); return result; }; @@ -188,12 +189,12 @@ MetadataPicking.decodeRawMetadataValueElement = function ( */ MetadataPicking.decodeRawMetadataValues = function ( classProperty, - rawPixelValues, + rawPixelValues ) { const dataView = new DataView( rawPixelValues.buffer, rawPixelValues.byteOffset, - rawPixelValues.byteLength, + rawPixelValues.byteLength ); if (classProperty.isArray) { const arrayLength = classProperty.arrayLength; @@ -202,7 +203,7 @@ MetadataPicking.decodeRawMetadataValues = function ( const element = MetadataPicking.decodeRawMetadataValueElement( classProperty, dataView, - i, + i ); result[i] = element; } @@ -211,7 +212,7 @@ MetadataPicking.decodeRawMetadataValues = function ( const result = MetadataPicking.decodeRawMetadataValueElement( classProperty, dataView, - 0, + 0 ); return result; }; @@ -276,11 +277,11 @@ MetadataPicking.convertToObjectType = function (type, value) { */ MetadataPicking.decodeMetadataValues = function ( classProperty, - rawPixelValues, + rawPixelValues ) { const arrayBasedResult = MetadataPicking.decodeRawMetadataValues( classProperty, - rawPixelValues, + rawPixelValues ); if (classProperty.isArray) { const arrayLength = classProperty.arrayLength; @@ -289,7 +290,7 @@ MetadataPicking.decodeMetadataValues = function ( const arrayBasedValue = arrayBasedResult[i]; const objectBasedValue = MetadataPicking.convertToObjectType( classProperty.type, - arrayBasedValue, + arrayBasedValue ); result[i] = objectBasedValue; } @@ -297,7 +298,7 @@ MetadataPicking.decodeMetadataValues = function ( } const result = MetadataPicking.convertToObjectType( classProperty.type, - arrayBasedResult, + arrayBasedResult ); return result; }; diff --git a/packages/engine/Source/Scene/MetadataSchemaLoader.js b/packages/engine/Source/Scene/MetadataSchemaLoader.js index fd09000df38b..f4a674920336 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 b6113c96b63f..9a3857716060 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 3af58b4f559e..8198e0151652 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 c21113304ac4..2f1d542f6d6f 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 11128da39bd7..46b9e97debda 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 c9bb0feff45a..600221ac4dde 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 fd9047de3473..07c0f16718de 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 92497c0271a7..339f6492126c 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 1b8c3c91115c..4d23fa50ef79 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 35e476baf99f..ae0e48d03f7e 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 d4ead8fbd3ba..eef3163b7d63 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 400a31f4828f..dc53af42acf1 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,8 +381,9 @@ function generateFragmentShaderLines(customShader, attributesByName) { return { enabled: true, attributeFields: attributeFields.concat(positionBuiltins.attributeFields), - initializationLines: - positionBuiltins.initializationLines.concat(initializationLines), + initializationLines: positionBuiltins.initializationLines.concat( + initializationLines + ), }; } @@ -405,7 +406,7 @@ const builtinAttributes = { function getPrimitiveAttributesUsedInShader( primitiveAttributes, shaderAttributeSet, - isFragmentShader, + isFragmentShader ) { const addToShader = {}; for (const attributeName in primitiveAttributes) { @@ -445,7 +446,7 @@ function getPrimitiveAttributesUsedInShader( function getAttributesNeedingDefaults( primitiveAttributes, shaderAttributeSet, - isFragmentShader, + isFragmentShader ) { const needDefaults = []; for (const attributeName in shaderAttributeSet) { @@ -486,7 +487,7 @@ function generateShaderLines(customShader, primitive) { const vertexLines = generateVertexShaderLines(customShader, attributesByName); const fragmentLines = generateFragmentShaderLines( customShader, - attributesByName, + attributesByName ); // positionWC must be computed in the vertex shader @@ -512,7 +513,7 @@ function addVertexLinesToShader(shaderBuilder, vertexLines) { shaderBuilder.addStruct( structId, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - ShaderDestination.VERTEX, + ShaderDestination.VERTEX ); const { attributeFields, initializationLines } = vertexLines; @@ -527,36 +528,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 = @@ -564,7 +565,7 @@ function addVertexLinesToShader(shaderBuilder, vertexLines) { shaderBuilder.addFunction( functionId, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS, - ShaderDestination.VERTEX, + ShaderDestination.VERTEX ); shaderBuilder.addFunctionLines(functionId, initializationLines); @@ -575,7 +576,7 @@ function addFragmentLinesToShader(shaderBuilder, fragmentLines) { shaderBuilder.addStruct( structId, CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); const { attributeFields, initializationLines } = fragmentLines; @@ -588,36 +589,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 = @@ -625,7 +626,7 @@ function addFragmentLinesToShader(shaderBuilder, fragmentLines) { shaderBuilder.addFunction( functionId, CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addFunctionLines(functionId, initializationLines); @@ -644,7 +645,7 @@ function addLinesToShader(shaderBuilder, customShader, generatedCode) { shaderLines.push( "#line 0", customShader.vertexShaderText, - CustomShaderStageVS, + CustomShaderStageVS ); shaderBuilder.addVertexLines(shaderLines); @@ -657,7 +658,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 def5ddbbb4e9..dc5a21317b05 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/Extensions/Gpm/GltfGpmLoader.js b/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js index f3cd3e2dd2d7..acb6c3fdc549 100644 --- a/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +++ b/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js @@ -41,7 +41,7 @@ function createCovarianceMatrixFromUpperTriangle(array) { array[4], array[3], array[4], - array[5], + array[5] ); return covarianceMatrix; } @@ -56,12 +56,12 @@ function createAnchorPointDirect(anchorPointDirectJson) { const position = Cartesian3.fromArray( anchorPointDirectJson.position, 0, - new Cartesian3(), + new Cartesian3() ); const adjustmentParams = Cartesian3.fromArray( anchorPointDirectJson.adjustmentParams, 0, - new Cartesian3(), + new Cartesian3() ); const anchorPointDirect = new AnchorPointDirect({ position: position, @@ -80,15 +80,15 @@ function createAnchorPointIndirect(anchorPointIndirectJson) { const position = Cartesian3.fromArray( anchorPointIndirectJson.position, 0, - new Cartesian3(), + new Cartesian3() ); const adjustmentParams = Cartesian3.fromArray( anchorPointIndirectJson.adjustmentParams, 0, - new Cartesian3(), + new Cartesian3() ); const covarianceMatrix = createCovarianceMatrixFromUpperTriangle( - anchorPointIndirectJson.covarianceMatrix, + anchorPointIndirectJson.covarianceMatrix ); const anchorPointIndirect = new AnchorPointIndirect({ position: position, @@ -109,7 +109,7 @@ function createCorrelationGroup(correlationGroupJson) { const rotationThetas = Cartesian3.fromArray( correlationGroupJson.rotationThetas, 0, - new Cartesian3(), + new Cartesian3() ); const params = []; for (const paramJson of correlationGroupJson.params) { @@ -151,7 +151,7 @@ GltfGpmLoader.load = function (gltfGpmLocalJson) { return GltfGpmLoader.loadIndirect(gltfGpmLocalJson); } throw new RuntimeError( - `Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${storageType}`, + `Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${storageType}` ); }; @@ -170,11 +170,11 @@ GltfGpmLoader.loadDirect = function (gltfGpmLocalJson) { Check.typeOf.object("gltfGpmLocalJson", gltfGpmLocalJson); Check.typeOf.object( "gltfGpmLocalJson.anchorPointsDirect", - gltfGpmLocalJson.anchorPointsDirect, + gltfGpmLocalJson.anchorPointsDirect ); Check.typeOf.object( "gltfGpmLocalJson.covarianceDirectUpperTriangle", - gltfGpmLocalJson.covarianceDirectUpperTriangle, + gltfGpmLocalJson.covarianceDirectUpperTriangle ); //>>includeEnd('debug'); @@ -185,7 +185,7 @@ GltfGpmLoader.loadDirect = function (gltfGpmLocalJson) { anchorPointsDirect.push(anchorPointDirect); } const covarianceDirect = createCovarianceMatrixFromUpperTriangle( - gltfGpmLocalJson.covarianceDirectUpperTriangle, + gltfGpmLocalJson.covarianceDirectUpperTriangle ); const gltfGpmLocal = new GltfGpmLocal({ @@ -211,11 +211,11 @@ GltfGpmLoader.loadIndirect = function (gltfGpmLocalJson) { Check.typeOf.object("gltfGpmLocalJson", gltfGpmLocalJson); Check.typeOf.object( "gltfGpmLocalJson.anchorPointsIndirect", - gltfGpmLocalJson.anchorPointsIndirect, + gltfGpmLocalJson.anchorPointsIndirect ); Check.typeOf.object( "gltfGpmLocalJson.intraTileCorrelationGroups", - gltfGpmLocalJson.intraTileCorrelationGroups, + gltfGpmLocalJson.intraTileCorrelationGroups ); //>>includeEnd('debug'); @@ -223,7 +223,7 @@ GltfGpmLoader.loadIndirect = function (gltfGpmLocalJson) { const anchorPointsIndirectJson = gltfGpmLocalJson.anchorPointsIndirect; for (const anchorPointIndirectJson of anchorPointsIndirectJson) { const anchorPointIndirect = createAnchorPointIndirect( - anchorPointIndirectJson, + anchorPointIndirectJson ); anchorPointsIndirect.push(anchorPointIndirect); } diff --git a/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLocal.js b/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLocal.js index 80339c2247e6..3d17a05044f9 100644 --- a/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLocal.js +++ b/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfGpmLocal.js @@ -64,44 +64,44 @@ function GltfGpmLocal(options) { if (this.storageType === StorageType.Indirect) { if (!defined(this.anchorPointsIndirect)) { throw new RuntimeError( - "The anchorPointsIndirect are required for 'Indirect' storage", + "The anchorPointsIndirect are required for 'Indirect' storage" ); } if (!defined(this.intraTileCorrelationGroups)) { throw new RuntimeError( - "The intraTileCorrelationGroups are required for 'Indirect' storage", + "The intraTileCorrelationGroups are required for 'Indirect' storage" ); } if (defined(this.anchorPointsDirect)) { throw new RuntimeError( - "The anchorPointsDirect must be omitted for 'Indirect' storage", + "The anchorPointsDirect must be omitted for 'Indirect' storage" ); } if (defined(this.covarianceDirect)) { throw new RuntimeError( - "The covarianceDirect must be omitted for 'Indirect' storage", + "The covarianceDirect must be omitted for 'Indirect' storage" ); } } else { // Direct storage if (!defined(this.anchorPointsDirect)) { throw new RuntimeError( - "The anchorPointsDirect are required for 'Direct' storage", + "The anchorPointsDirect are required for 'Direct' storage" ); } if (!defined(this.covarianceDirect)) { throw new RuntimeError( - "The covarianceDirect is required for 'Direct' storage", + "The covarianceDirect is required for 'Direct' storage" ); } if (defined(this.anchorPointsIndirect)) { throw new RuntimeError( - "The anchorPointsIndirect must be omitted for 'Direct' storage", + "The anchorPointsIndirect must be omitted for 'Direct' storage" ); } if (defined(this.intraTileCorrelationGroups)) { throw new RuntimeError( - "The intraTileCorrelationGroups must be omitted for 'Direct' storage", + "The intraTileCorrelationGroups must be omitted for 'Direct' storage" ); } } diff --git a/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js b/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js index 7be022144311..3d7f66679d65 100644 --- a/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js +++ b/packages/engine/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js @@ -76,7 +76,7 @@ function GltfMeshPrimitiveGpmLoader(options) { if (defined(Object.create)) { GltfMeshPrimitiveGpmLoader.prototype = Object.create( - ResourceLoader.prototype, + ResourceLoader.prototype ); GltfMeshPrimitiveGpmLoader.prototype.constructor = GltfMeshPrimitiveGpmLoader; } @@ -240,7 +240,7 @@ GltfMeshPrimitiveGpmLoader.ppeTexturesMetadataSchemaCache = new Map(); */ GltfMeshPrimitiveGpmLoader._createPpeTextureClassJson = function ( ppeTexture, - index, + index ) { const traits = ppeTexture.traits; const ppePropertyName = traits.source; @@ -301,15 +301,15 @@ GltfMeshPrimitiveGpmLoader._createPpeTextureClassJson = function ( * @returns The `MetadataSchema` */ GltfMeshPrimitiveGpmLoader._obtainPpeTexturesMetadataSchema = function ( - meshPrimitiveGpmLocal, + meshPrimitiveGpmLocal ) { - const ppeTexturePropertyIdentifiers = - GltfMeshPrimitiveGpmLoader._collectPpeTexturePropertyIdentifiers( - meshPrimitiveGpmLocal, - ); + const ppeTexturePropertyIdentifiers = GltfMeshPrimitiveGpmLoader._collectPpeTexturePropertyIdentifiers( + meshPrimitiveGpmLocal + ); const key = ppeTexturePropertyIdentifiers.toString(); - let ppeTexturesMetadataSchema = - GltfMeshPrimitiveGpmLoader.ppeTexturesMetadataSchemaCache.get(key); + let ppeTexturesMetadataSchema = GltfMeshPrimitiveGpmLoader.ppeTexturesMetadataSchemaCache.get( + key + ); if (defined(ppeTexturesMetadataSchema)) { return ppeTexturesMetadataSchema; } @@ -326,17 +326,17 @@ GltfMeshPrimitiveGpmLoader._obtainPpeTexturesMetadataSchema = function ( const classId = `ppeTexture_${i}`; const classJson = GltfMeshPrimitiveGpmLoader._createPpeTextureClassJson( ppeTexture, - i, + i ); ppeTexturesMetadataSchemaJson.classes[classId] = classJson; } ppeTexturesMetadataSchema = MetadataSchema.fromJson( - ppeTexturesMetadataSchemaJson, + ppeTexturesMetadataSchemaJson ); GltfMeshPrimitiveGpmLoader.ppeTexturesMetadataSchemaCache.set( key, - ppeTexturesMetadataSchema, + ppeTexturesMetadataSchema ); return ppeTexturesMetadataSchema; }; @@ -357,7 +357,7 @@ GltfMeshPrimitiveGpmLoader._obtainPpeTexturesMetadataSchema = function ( * @returns The identifiers */ GltfMeshPrimitiveGpmLoader._collectPpeTexturePropertyIdentifiers = function ( - meshPrimitiveGpmLocal, + meshPrimitiveGpmLocal ) { const ppeTexturePropertyIdentifiers = []; const ppeTextures = meshPrimitiveGpmLocal.ppeTextures; @@ -369,7 +369,7 @@ GltfMeshPrimitiveGpmLoader._collectPpeTexturePropertyIdentifiers = function ( // schema. const classJson = GltfMeshPrimitiveGpmLoader._createPpeTextureClassJson( ppeTexture, - i, + i ); const ppeTexturePropertyIdentifier = JSON.stringify(classJson); ppeTexturePropertyIdentifiers.push(ppeTexturePropertyIdentifier); @@ -391,13 +391,12 @@ GltfMeshPrimitiveGpmLoader._collectPpeTexturePropertyIdentifiers = function ( */ GltfMeshPrimitiveGpmLoader._convertToStructuralMetadata = function ( meshPrimitiveGpmLocal, - textures, + textures ) { const propertyTextures = []; - const ppeTexturesMetadataSchema = - GltfMeshPrimitiveGpmLoader._obtainPpeTexturesMetadataSchema( - meshPrimitiveGpmLocal, - ); + const ppeTexturesMetadataSchema = GltfMeshPrimitiveGpmLoader._obtainPpeTexturesMetadataSchema( + meshPrimitiveGpmLocal + ); const ppeTextures = meshPrimitiveGpmLocal.ppeTextures; for (let i = 0; i < ppeTextures.length; i++) { const ppeTexture = ppeTextures[i]; @@ -429,7 +428,7 @@ GltfMeshPrimitiveGpmLoader._convertToStructuralMetadata = function ( propertyTexture: ppeTextureAsPropertyTexture, class: metadataClass, textures: textures, - }), + }) ); } const structuralMetadata = new StructuralMetadata({ @@ -513,11 +512,10 @@ GltfMeshPrimitiveGpmLoader.prototype.process = function (frameState) { const meshPrimitiveGpmLocal = new MeshPrimitiveGpmLocal(ppeTextures); this._meshPrimitiveGpmLocal = meshPrimitiveGpmLocal; - const structuralMetadata = - GltfMeshPrimitiveGpmLoader._convertToStructuralMetadata( - meshPrimitiveGpmLocal, - textures, - ); + const structuralMetadata = GltfMeshPrimitiveGpmLoader._convertToStructuralMetadata( + meshPrimitiveGpmLocal, + textures + ); this._structuralMetadata = structuralMetadata; this._state = ResourceLoaderState.READY; diff --git a/packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js b/packages/engine/Source/Scene/Model/FeatureIdPipelineStage.js index a4f25ff160f9..5c3d8ef5c083 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/GaussianSplatPipelineStage.js b/packages/engine/Source/Scene/Model/GaussianSplatPipelineStage.js new file mode 100644 index 000000000000..7fff231bff75 --- /dev/null +++ b/packages/engine/Source/Scene/Model/GaussianSplatPipelineStage.js @@ -0,0 +1,394 @@ +import ShaderDestination from "../../Renderer/ShaderDestination.js"; +import GaussianSplatVS from "../../Shaders/Model/GaussianSplatVS.js"; +import GaussianSplatFS from "../../Shaders/Model/GaussianSplatFS.js"; +import Pass from "../../Renderer/Pass.js"; +import PrimitiveType from "../../Core/PrimitiveType.js"; +import BlendingState from "../BlendingState.js"; +import Matrix4 from "../../Core/Matrix4.js"; + +import __wbg_init, { + initSync, + radix_sort_gaussians_attrs, + radix_sort_simd, + GSplatData, +} from "cesiumjs-gsplat-utils"; + +import buildModuleUrl from "../../Core/buildModuleUrl.js"; + +let wasmInitialized = false; +let initPromise = null; +let wasmMod; + +class CesiumPerformanceTimer { + constructor() { + this.startTime = null; + this.endTime = null; + } + + start() { + this.startTime = performance.now(); + } + + end() { + this.endTime = performance.now(); + } + + getExecutionTime() { + if (!this.startTime || !this.endTime) { + throw new Error( + "Timer must be started and ended before getting execution time", + ); + } + return { + milliseconds: this.endTime - this.startTime, + }; + } + + reset() { + this.startTime = null; + this.endTime = null; + } +} + +const GaussianSplatPipelineStage = { + name: "GaussianSplatPipelineStage", +}; + +GaussianSplatPipelineStage.process = function ( + renderResources, + primitive, + frameState, +) { + const { shaderBuilder } = renderResources; + + const renderStateOptions = renderResources.renderStateOptions; + renderStateOptions.cull.enabled = false; + renderStateOptions.depthMask = false; + renderStateOptions.depthTest.enabled = false; + renderStateOptions.blending = BlendingState.PRE_MULTIPLIED_ALPHA_BLEND; + + renderResources.alphaOptions.pass = Pass.GAUSSIAN_SPLATS; + + shaderBuilder.addDefine( + "HAS_GAUSSIAN_SPLATS", + undefined, + ShaderDestination.BOTH, + ); + + if (primitive.hasAttributeTexture) { + shaderBuilder.addDefine( + "HAS_SPLAT_TEXTURE", + undefined, + ShaderDestination.BOTH, + ); + } + + shaderBuilder.addAttribute("vec2", "a_screenQuadPosition"); + shaderBuilder.addAttribute("float", "a_dummy"); + shaderBuilder.addAttribute("uvec3", "a_splatPosition"); + shaderBuilder.addAttribute("vec4", "a_splatColor"); + //shaderBuilder.addAttribute("float", "a_splatOpacity"); + + shaderBuilder.addVarying("vec4", "v_splatColor"); + shaderBuilder.addVarying("vec2", "v_vertPos"); + shaderBuilder.addVarying("float", "v_splatOpacity"); + shaderBuilder.addVarying("vec4", "v_splatScale"); + shaderBuilder.addVarying("vec4", "v_splatRot"); + + shaderBuilder.addUniform("float", "u_tan_fovX", ShaderDestination.VERTEX); + shaderBuilder.addUniform("float", "u_tan_fovY", ShaderDestination.VERTEX); + shaderBuilder.addUniform("float", "u_focalX", ShaderDestination.VERTEX); + shaderBuilder.addUniform("float", "u_focalY", ShaderDestination.VERTEX); + shaderBuilder.addUniform("float", "u_splatScale", ShaderDestination.VERTEX); + + shaderBuilder.addUniform("mat4", "u_scalingMatrix", ShaderDestination.VERTEX); + + const uniformMap = renderResources.uniformMap; + const cam = frameState.camera; + const width = frameState.context.drawingBufferWidth; + const height = frameState.context.drawingBufferHeight; + + const tan_fovx = Math.tan(cam.frustum.fov * 0.5); + const tan_fovy = Math.tan(cam.frustum.fovy * 0.5); + const focal_x = width / (tan_fovx * 2); + const focal_y = height / (tan_fovy * 2); + + uniformMap.u_tan_fovX = function () { + return tan_fovx; + }; + + uniformMap.u_tan_fovY = function () { + return tan_fovy; + }; + + uniformMap.u_focalX = function () { + return focal_x; + }; + + uniformMap.u_focalY = function () { + return focal_y; + }; + + uniformMap.u_splatScale = function () { + return renderResources.model?.style?.splatScale ?? 1.0; + }; + + uniformMap.u_scalingMatrix = function () { + return renderResources.model.sceneGraph.components.nodes[0].matrix; + }; + + const timer = new CesiumPerformanceTimer(); + + const radixSort = () => { + const attributes = primitive.attributes; + const modelView = new Matrix4(); + const modelMat = renderResources.model.modelMatrix; + Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + const posAttr = attributes.find((a) => a.name === "POSITION"); + const scaleAttr = attributes.find((a) => a.name === "_SCALE"); + const rotAttr = attributes.find((a) => a.name === "_ROTATION"); + const clrAttr = attributes.find((a) => a.name === "COLOR_0"); + + const posArray = posAttr.typedArray; + const scaleArray = scaleAttr.typedArray; + const rotArray = rotAttr.typedArray; + const clrArray = clrAttr.typedArray; + + const newPosArray = new posArray.constructor(posArray.length); + const newScaleArray = new scaleArray.constructor(scaleArray.length); + const newRotArray = new rotArray.constructor(rotArray.length); + const newClrArray = new clrArray.constructor(clrArray.length); + + const calcDepth = (i) => + posArray[i * 3] * modelView[2] + + posArray[i * 3 + 1] * modelView[6] + + posArray[i * 3 + 2] * modelView[10]; + timer.start(); + const depthValues = new Int32Array(renderResources.count); + let maxDepth = -Infinity; + let minDepth = Infinity; + + for (let i = 0; i < renderResources.count; i++) { + const depth = (calcDepth(i) * 4096) | 0; + depthValues[i] = depth; + maxDepth = Math.max(maxDepth, depth); + minDepth = Math.min(minDepth, depth); + } + + const depthOffset = -minDepth; + for (let i = 0; i < renderResources.count; i++) { + depthValues[i] += depthOffset; + } + + const indices = new Uint32Array(renderResources.count); + for (let i = 0; i < renderResources.count; i++) { + indices[i] = i; + } + + const tempDepths = new Int32Array(renderResources.count); + const tempIndices = new Uint32Array(renderResources.count); + + for (let shift = 0; shift < 32; shift += 8) { + const counts = new Uint32Array(256); + + for (let i = 0; i < renderResources.count; i++) { + const byte = (depthValues[i] >> shift) & 0xff; + counts[byte]++; + } + + let total = 0; + for (let i = 0; i < 256; i++) { + const count = counts[i]; + counts[i] = total; + total += count; + } + + for (let i = 0; i < renderResources.count; i++) { + const byte = (depthValues[i] >> shift) & 0xff; + const pos = counts[byte]++; + + tempDepths[pos] = depthValues[i]; + tempIndices[pos] = indices[i]; + } + + depthValues.set(tempDepths); + indices.set(tempIndices); + } + + for (let i = 0; i < renderResources.count; i++) { + const j = indices[i]; + + newPosArray[i * 3] = posArray[j * 3]; + newPosArray[i * 3 + 1] = posArray[j * 3 + 1]; + newPosArray[i * 3 + 2] = posArray[j * 3 + 2]; + + newScaleArray[i * 3] = scaleArray[j * 3]; + newScaleArray[i * 3 + 1] = scaleArray[j * 3 + 1]; + newScaleArray[i * 3 + 2] = scaleArray[j * 3 + 2]; + + newRotArray[i * 4] = rotArray[j * 4]; + newRotArray[i * 4 + 1] = rotArray[j * 4 + 1]; + newRotArray[i * 4 + 2] = rotArray[j * 4 + 2]; + newRotArray[i * 4 + 3] = rotArray[j * 4 + 3]; + + newClrArray[i * 4] = clrArray[j * 4]; + newClrArray[i * 4 + 1] = clrArray[j * 4 + 1]; + newClrArray[i * 4 + 2] = clrArray[j * 4 + 2]; + newClrArray[i * 4 + 3] = clrArray[j * 4 + 3]; + } + + posAttr.typedArray = newPosArray; + scaleAttr.typedArray = newScaleArray; + rotAttr.typedArray = newRotArray; + clrAttr.typedArray = newClrArray; + timer.end(); + + const rExecTime = timer.getExecutionTime(); + console.log(`RadixSort Execution time: ${rExecTime.milliseconds}ms`); + }; + + const radixWasmSimd = async () => { + async function ensureWasmInitialized() { + if (!initPromise) { + initPromise = await __wbg_init( + buildModuleUrl( + "ThirdParty/cesium-gsplat/cesiumjs_gsplat_utils_bg.wasm", + ), + ) + .then((wasm) => { + wasmInitialized = true; + initSync(wasm); + wasmMod = wasm; + }) + .catch((err) => { + console.error("Failed to initialize WASM module:", err); + throw err; + }); + } + return initPromise; + } + + if (!wasmMod) { + ensureWasmInitialized(); + } + + if (!wasmInitialized) { + return; + } + + const attributes = primitive.attributes; + const modelView = new Matrix4(); + const modelMat = renderResources.model.modelMatrix; + Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + const posAttr = attributes.find((a) => a.name === "POSITION"); + const scaleAttr = attributes.find((a) => a.name === "_SCALE"); + const rotAttr = attributes.find((a) => a.name === "_ROTATION"); + const clrAttr = attributes.find((a) => a.name === "COLOR_0"); + + initSync(wasmMod); + const gsData = GSplatData.fromFloat32Arrays( + posAttr.typedArray, + scaleAttr.typedArray, + rotAttr.typedArray, + clrAttr.typedArray, + modelView, + renderResources.count, + ); + + radix_sort_simd(gsData); + + posAttr.typedArray = gsData.getPositions(); + scaleAttr.typedArray = gsData.getScales(); + rotAttr.typedArray = gsData.getRotations(); + clrAttr.typedArray = gsData.getColors(); + }; + + const radixWasm = () => { + async function ensureWasmInitialized() { + if (!initPromise) { + initPromise = await __wbg_init( + buildModuleUrl("ThirdParty/cesiumjs_gsplat_utils_bg.wasm"), + ) + .then((wasm) => { + wasmInitialized = true; + initSync(wasm); + wasmMod = wasm; + }) + .catch((err) => { + console.error("Failed to initialize WASM module:", err); + throw err; + }); + } + return initPromise; + } + + if (!wasmMod) { + ensureWasmInitialized(); + } + + if (!wasmInitialized) { + return; + } + + const attributes = primitive.attributes; + const modelView = new Matrix4(); + const modelMat = renderResources.model.modelMatrix; + Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + const posAttr = attributes.find((a) => a.name === "POSITION"); + const scaleAttr = attributes.find((a) => a.name === "_SCALE"); + const rotAttr = attributes.find((a) => a.name === "_ROTATION"); + const clrAttr = attributes.find((a) => a.name === "COLOR_0"); + + const posArray = posAttr.typedArray; + const scaleArray = scaleAttr.typedArray; + const rotArray = rotAttr.typedArray; + const clrArray = clrAttr.typedArray; + + initSync(wasmMod); + + const [newPositions, newScales, newRotations, newColors] = + radix_sort_gaussians_attrs( + posArray, + scaleArray, + rotArray, + clrArray, + modelView, + renderResources.count, + ); + + posAttr.typedArray = newPositions; + scaleAttr.typedArray = newScales; + rotAttr.typedArray = newRotations; + clrAttr.typedArray = newColors; + }; + + radixSort(); + + const useWasm = false; + if (useWasm) { + timer.start(); + radixWasm(); + + timer.end(); + + timer.start(); + radixWasmSimd(); + + timer.end(); + } + + const rExecTime = timer.getExecutionTime(); + console.log(`RadixSort Execution time: ${rExecTime.milliseconds}ms`); + + renderResources.instanceCount = renderResources.count; + renderResources.count = 4; + renderResources.primitiveType = PrimitiveType.TRIANGLE_STRIP; + + shaderBuilder.addVertexLines(GaussianSplatVS); + shaderBuilder.addFragmentLines(GaussianSplatFS); +}; + +export default GaussianSplatPipelineStage; diff --git a/packages/engine/Source/Scene/Model/GaussianSplatTextureGenerator.js b/packages/engine/Source/Scene/Model/GaussianSplatTextureGenerator.js new file mode 100644 index 000000000000..3f336ba58c7f --- /dev/null +++ b/packages/engine/Source/Scene/Model/GaussianSplatTextureGenerator.js @@ -0,0 +1,125 @@ +import __wbg_init, { + initSync, + generate_splat_texture_from_attrs, +} from "cesiumjs-gsplat-utils"; +import buildModuleUrl from "../../Core/buildModuleUrl.js"; + +//TODO: move to TaskProcessor + +GaussianSplatTextureGenerator.wasmModule = undefined; +GaussianSplatTextureGenerator.wasmInitialized = false; +GaussianSplatTextureGenerator.initPromise = null; + +function GaussianSplatTextureGenerator() {} + +GaussianSplatTextureGenerator.initWasmModule = function () { + (async () => { + if (!this.initPromise) { + this.initPromise = await __wbg_init( + buildModuleUrl("ThirdParty/cesiumjs_gsplat_utils_bg.wasm"), + ) + .then((wasm) => { + this.wasmInitialized = true; + initSync(wasm); + this.wasmModule = wasm; + }) + .catch((err) => { + console.error("Failed to initialize WASM module:", err); + throw err; + }); + } + })(); + return this.initPromise; +}; + +//Attributes +//Position (vec3) +//Scale (vec3) +//Rotation (vec4) +//RGBA (u8 * 4) +GaussianSplatTextureGenerator.generateFromAttrs = async function ( + attributes, + count, +) { + if (!this.wasmModule || !this.wasmInitialized) { + this.initWasmModule(); + + while (!this.wasmModule) { + await new Promise((r) => setTimeout(r, 100)); + } + } + + return generate_splat_texture_from_attrs( + attributes.find((a) => a.name === "POSITION").typedArray, + attributes.find((a) => a.name === "_SCALE").typedArray, + attributes.find((a) => a.name === "_ROTATION").typedArray, + attributes.find((a) => a.name === "COLOR_0").typedArray, + count, + ); +}; +//////////////////////////////////////////////////// +/////// + +// import defined from "../../Core/defined.js"; +// import FeatureDetection from "../../Core/FeatureDetection.js"; +// import RuntimeError from "../../Core/RuntimeError.js"; +// import TaskProcessor from "../../Core/TaskProcessor.js"; + +// function GaussianSplatTextureGenerator() {} + +// GaussianSplatTextureGenerator._maxSortingConcurrency = Math.max( +// FeatureDetection.hardwareConcurrency - 1, +// 1, +// ); + +// GaussianSplatTextureGenerator._textureTaskProcessor = undefined; +// GaussianSplatTextureGenerator._taskProcessorReady = false; +// GaussianSplatTextureGenerator._error = undefined; +// GaussianSplatTextureGenerator._getTextureTaskProcessor = function () { +// if (!defined(GaussianSplatTextureGenerator._textureTaskProcessor)) { +// const processor = new TaskProcessor( +// "gaussianSplatTextureGenerator", +// GaussianSplatTextureGenerator._maxSortingConcurrency, +// ); +// processor +// .initWebAssemblyModule({ +// wasmBinaryFile: "ThirdParty/cesium-gsplat/cesiumjs_gsplat_utils_bg.wasm", +// }) +// .then(function (result) { +// if (result) { +// GaussianSplatTextureGenerator._taskProcessorReady = true; +// } else { +// GaussianSplatTextureGenerator._error = new RuntimeError( +// "Gaussian splat sorter could not be initialized.", +// ); +// } +// }) +// .catch((error) => { +// GaussianSplatTextureGenerator._error = error; +// }); +// GaussianSplatTextureGenerator._textureTaskProcessor = processor; +// } + +// return GaussianSplatTextureGenerator._textureTaskProcessor; +// }; + +// GaussianSplatTextureGenerator.generateFromAttrs = function (parameters) { +// const textureTaskProcessor = GaussianSplatTextureGenerator._getTextureTaskProcessor(); +// if (defined(GaussianSplatTextureGenerator._error)) { +// throw GaussianSplatTextureGenerator._error; +// } + +// if (!GaussianSplatTextureGenerator._taskProcessorReady) { +// return; +// } + +// const { attributes } = parameters; +// return textureTaskProcessor.scheduleTask(parameters,[ +// attributes.positions.typedArray, +// attributes.scales.typedArray, +// attributes.rotations.typedArray, +// attributes.colors.typedArray +// ]); +// }; + +export default GaussianSplatTextureGenerator; diff --git a/packages/engine/Source/Scene/Model/GaussianSplatTexturePipelineStage.js b/packages/engine/Source/Scene/Model/GaussianSplatTexturePipelineStage.js new file mode 100644 index 000000000000..41d50c8c6383 --- /dev/null +++ b/packages/engine/Source/Scene/Model/GaussianSplatTexturePipelineStage.js @@ -0,0 +1,453 @@ +import ShaderDestination from "../../Renderer/ShaderDestination.js"; +import GaussianSplatVS from "../../Shaders/Model/GaussianSplatVS.js"; +import GaussianSplatFS from "../../Shaders/Model/GaussianSplatFS.js"; +import Pass from "../../Renderer/Pass.js"; +import PrimitiveType from "../../Core/PrimitiveType.js"; +import BlendingState from "../BlendingState.js"; +import Matrix4 from "../../Core/Matrix4.js"; +import __wbg_init, { + initSync, + radix_sort_gaussians_attrs, + radix_sort_simd, + GSplatData, +} from "cesiumjs-gsplat-utils"; + +import GaussianSplatTextureGenerator from "./GaussianSplatTextureGenerator.js"; + +import buildModuleUrl from "../../Core/buildModuleUrl.js"; + +import PixelFormat from "../../Core/PixelFormat.js"; +import PixelDatatype from "../../Renderer/PixelDatatype.js"; +import Sampler from "../../Renderer/Sampler.js"; +import Texture from "../../Renderer/Texture.js"; + +let wasmInitialized = false; +let initPromise = null; +let wasmMod; + +class CesiumPerformanceTimer { + constructor() { + this.startTime = null; + this.endTime = null; + } + + start() { + this.startTime = performance.now(); + } + + end() { + this.endTime = performance.now(); + } + + getExecutionTime() { + if (!this.startTime || !this.endTime) { + throw new Error( + "Timer must be started and ended before getting execution time", + ); + } + return { + milliseconds: this.endTime - this.startTime, + }; + } + + reset() { + this.startTime = null; + this.endTime = null; + } +} + +const GaussianSplatTexturePipelineStage = { + name: "GaussianSplatTexturePipelineStage", +}; + +GaussianSplatTexturePipelineStage.process = function ( + renderResources, + primitive, + frameState, +) { + if (GaussianSplatTextureGenerator.wasmInitialized === false) { + return; + } + const { shaderBuilder } = renderResources; + + const renderStateOptions = renderResources.renderStateOptions; + renderStateOptions.cull.enabled = false; + renderStateOptions.depthMask = false; + renderStateOptions.depthTest.enabled = false; + renderStateOptions.blending = BlendingState.PRE_MULTIPLIED_ALPHA_BLEND; + + renderResources.alphaOptions.pass = Pass.GAUSSIAN_SPLATS; + + shaderBuilder.addDefine( + "HAS_GAUSSIAN_SPLATS", + undefined, + ShaderDestination.BOTH, + ); + + shaderBuilder.addDefine( + "HAS_SPLAT_TEXTURE", + undefined, + ShaderDestination.BOTH, + ); + + shaderBuilder.addAttribute("vec2", "a_screenQuadPosition"); + shaderBuilder.addAttribute("float", "a_splatIndex"); + + shaderBuilder.addVarying("vec4", "v_splatColor"); + shaderBuilder.addVarying("vec2", "v_vertPos"); + + shaderBuilder.addUniform( + "highp usampler2D", + "u_splatAttributeTexture", + ShaderDestination.VERTEX, + ); + + shaderBuilder.addUniform("mat4", "u_scalingMatrix", ShaderDestination.VERTEX); + + shaderBuilder.addUniform("float", "u_splatScale", ShaderDestination.VERTEX); + + const uniformMap = renderResources.uniformMap; + const cam = frameState.camera; + + uniformMap.u_splatScale = function () { + return renderResources.model?.style?.splatScale ?? 1.0; + }; + + uniformMap.u_splatAttributeTexture = function () { + return primitive.gaussianSplatTexture; + }; + + uniformMap.u_scalingMatrix = function () { + return renderResources.model.sceneGraph.components.nodes[0].matrix; + }; + + const timer = new CesiumPerformanceTimer(); + const radixWasmSimd = async () => { + async function ensureWasmInitialized() { + if (!initPromise) { + initPromise = await __wbg_init( + buildModuleUrl( + "ThirdParty/cesium-gsplat/cesiumjs_gsplat_utils_bg.wasm", + ), + ) + .then((wasm) => { + wasmInitialized = true; + initSync(wasm); + wasmMod = wasm; + }) + .catch((err) => { + console.error("Failed to initialize WASM module:", err); + throw err; + }); + } + return initPromise; + } + + if (!wasmMod) { + ensureWasmInitialized(); + } + + if (!wasmInitialized) { + return; + } + + const attributes = primitive.attributes; + const modelView = new Matrix4(); + const modelMat = renderResources.model.modelMatrix; + Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + const posAttr = attributes.find((a) => a.name === "POSITION"); + const scaleAttr = attributes.find((a) => a.name === "_SCALE"); + const rotAttr = attributes.find((a) => a.name === "_ROTATION"); + const clrAttr = attributes.find((a) => a.name === "COLOR_0"); + + initSync(wasmMod); + const gsData = GSplatData.fromFloat32Arrays( + posAttr.typedArray, + scaleAttr.typedArray, + rotAttr.typedArray, + clrAttr.typedArray, + modelView, + renderResources.count, + ); + + radix_sort_simd(gsData); + + posAttr.typedArray = gsData.getPositions(); + scaleAttr.typedArray = gsData.getScales(); + rotAttr.typedArray = gsData.getRotations(); + clrAttr.typedArray = gsData.getColors(); + }; + + const radixWasm = () => { + async function ensureWasmInitialized() { + if (!initPromise) { + initPromise = await __wbg_init( + buildModuleUrl("ThirdParty/cesiumjs_gsplat_utils_bg.wasm"), + ) + .then((wasm) => { + wasmInitialized = true; + initSync(wasm); + wasmMod = wasm; + }) + .catch((err) => { + console.error("Failed to initialize WASM module:", err); + throw err; + }); + } + return initPromise; + } + + if (!wasmMod) { + ensureWasmInitialized(); + } + + if (!wasmInitialized) { + return; + } + + const attributes = primitive.attributes; + const modelView = new Matrix4(); + const modelMat = renderResources.model.modelMatrix; + Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + const posAttr = attributes.find((a) => a.name === "POSITION"); + const scaleAttr = attributes.find((a) => a.name === "_SCALE"); + const rotAttr = attributes.find((a) => a.name === "_ROTATION"); + const clrAttr = attributes.find((a) => a.name === "COLOR_0"); + + const posArray = posAttr.typedArray; + const scaleArray = scaleAttr.typedArray; + const rotArray = rotAttr.typedArray; + const clrArray = clrAttr.typedArray; + + initSync(wasmMod); + timer.start(); + const [newPositions, newScales, newRotations, newColors] = + radix_sort_gaussians_attrs( + posArray, + scaleArray, + rotArray, + clrArray, + modelView, + renderResources.count, + ); + timer.end(); + + const rExecTime = timer.getExecutionTime(); + console.log(`RadixSort Execution time: ${rExecTime.milliseconds}ms`); + posAttr.typedArray = newPositions; + scaleAttr.typedArray = newScales; + rotAttr.typedArray = newRotations; + clrAttr.typedArray = newColors; + + GaussianSplatTextureGenerator.generateFromAttrs( + primitive.attributes, + primitive.attributes[0].count, + ).then((splatTextureData) => { + const splatTex = new Texture({ + context: frameState.context, + source: { + width: splatTextureData.width, + height: splatTextureData.height, + arrayBufferView: splatTextureData.data, + }, + preMultiplyAlpha: false, + skipColorSpaceConversion: true, + pixelFormat: PixelFormat.RGBA_INTEGER, + pixelDatatype: PixelDatatype.UNSIGNED_INT, + flipY: false, + sampler: Sampler.NEAREST, + }); + primitive.gaussianSplatTexture = splatTex; + primitive.hasGaussianSplatTexture = true; + }); + }; + + // const radixSortIndexes = () => { + // const modelView = new Matrix4(); + // const modelMat = renderResources.model.modelMatrix; + // Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + // const posAttr = primitive.attributes.find((a) => a.name === "POSITION"); + // const idxAttr = primitive.attributes.find((a) => a.name === "_SPLAT_INDEXES"); + + // const posArray = posAttr.typedArray; + + // const calcDepth = (i) => + // posArray[i * 3] * modelView[2] + + // posArray[i * 3 + 1] * modelView[6] + + // posArray[i * 3 + 2] * modelView[10]; + + // const depthValues = new Int32Array(renderResources.count); + // let maxDepth = -Infinity; + // let minDepth = Infinity; + + // for (let i = 0; i < renderResources.count; i++) { + // const depth = (calcDepth(i) * 4096) | 0; + // depthValues[i] = depth; + // maxDepth = Math.max(maxDepth, depth); + // minDepth = Math.min(minDepth, depth); + // } + + // const depthOffset = -minDepth; + // for (let i = 0; i < renderResources.count; i++) { + // depthValues[i] += depthOffset; + // } + + // const texWidth = 1024; + // const texHeight = Math.ceil(renderResources.count / texWidth); + // const paddedSize = texWidth * texHeight; + + // const indices = new Uint32Array(paddedSize); + // for (let i = 0; i < renderResources.count; i++) { + // indices[i] = i; + // } + + // for (let i = renderResources.count; i < paddedSize; i++) { + // indices[i] = renderResources.count - 1; + // } + + // const tempDepths = new Int32Array(renderResources.count); + // const tempIndices = new Uint32Array(renderResources.count); + + // for (let shift = 0; shift < 32; shift += 8) { + // const counts = new Uint32Array(256); + + // for (let i = 0; i < renderResources.count; i++) { + // const byte = (depthValues[i] >> shift) & 0xff; + // counts[byte]++; + // } + + // let total = 0; + // for (let i = 0; i < 256; i++) { + // const count = counts[i]; + // counts[i] = total; + // total += count; + // } + + // for (let i = 0; i < renderResources.count; i++) { + // const byte = (depthValues[i] >> shift) & 0xff; + // const pos = counts[byte]++; + + // tempDepths[pos] = depthValues[i]; + // tempIndices[pos] = indices[i]; + // } + + // depthValues.set(tempDepths); + // indices.set(tempIndices.subarray(0, renderResources.count)); + // } + // idxAttr.typedArray = indices; + // }; + + const radixSimdWasmTexture = () => { + async function ensureWasmInitialized() { + if (!initPromise) { + initPromise = await __wbg_init( + buildModuleUrl( + "ThirdParty/cesium-gsplat/cesiumjs_gsplat_utils_bg.wasm", + ), + ) + .then((wasm) => { + wasmInitialized = true; + initSync(wasm); + wasmMod = wasm; + }) + .catch((err) => { + console.error("Failed to initialize WASM module:", err); + throw err; + }); + } + return initPromise; + } + + if (!wasmMod) { + ensureWasmInitialized(); + } + + if (!wasmInitialized) { + return; + } + + const attributes = primitive.attributes; + const modelView = new Matrix4(); + const modelMat = renderResources.model.modelMatrix; + Matrix4.multiply(cam.viewMatrix, modelMat, modelView); + + initSync(wasmMod); + + const posAttr = attributes.find((a) => a.name === "POSITION"); + const scaleAttr = attributes.find((a) => a.name === "_SCALE"); + const rotAttr = attributes.find((a) => a.name === "_ROTATION"); + const clrAttr = attributes.find((a) => a.name === "COLOR_0"); + + timer.start(); + const gsData = GSplatData.fromFloat32Arrays( + posAttr.typedArray, + scaleAttr.typedArray, + rotAttr.typedArray, + clrAttr.typedArray, + modelView, + renderResources.count, + ); + + radix_sort_simd(gsData); + + posAttr.typedArray = gsData.getPositions(); + scaleAttr.typedArray = gsData.getScales(); + rotAttr.typedArray = gsData.getRotations(); + clrAttr.typedArray = gsData.getColors(); + timer.end(); + + const rExecTime = timer.getExecutionTime(); + console.log(`RadixSort Execution time: ${rExecTime.milliseconds}ms`); + + GaussianSplatTextureGenerator.generateFromAttrs( + primitive.attributes, + primitive.attributes[0].count, + ).then((splatTextureData) => { + const splatTex = new Texture({ + context: frameState.context, + source: { + width: splatTextureData.width, + height: splatTextureData.height, + arrayBufferView: splatTextureData.data, + }, + preMultiplyAlpha: false, + skipColorSpaceConversion: true, + pixelFormat: PixelFormat.RGBA_INTEGER, + pixelDatatype: PixelDatatype.UNSIGNED_INT, + flipY: false, + sampler: Sampler.NEAREST, + }); + primitive.gaussianSplatTexture = splatTex; + primitive.hasGaussianSplatTexture = true; + }); + }; + + const useWasm = false; + if (useWasm) { + timer.start(); + radixWasm(); + + timer.end(); + + timer.start(); + radixWasmSimd(); + + timer.end(); + + timer.start(); + radixSimdWasmTexture(); + timer.end(); + } + + renderResources.instanceCount = renderResources.count; + renderResources.count = 4; + renderResources.primitiveType = PrimitiveType.TRIANGLE_STRIP; + + shaderBuilder.addVertexLines(GaussianSplatVS); + shaderBuilder.addFragmentLines(GaussianSplatFS); +}; + +export default GaussianSplatTexturePipelineStage; diff --git a/packages/engine/Source/Scene/Model/GeoJsonLoader.js b/packages/engine/Source/Scene/Model/GeoJsonLoader.js index 092962cd10f5..5bc67d5ec9ca 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 45a8e2b42c60..e90eb0cf68ed 100644 --- a/packages/engine/Source/Scene/Model/GeometryPipelineStage.js +++ b/packages/engine/Source/Scene/Model/GeometryPipelineStage.js @@ -12,6 +12,9 @@ import ModelUtility from "./ModelUtility.js"; import SelectedFeatureIdPipelineStage from "./SelectedFeatureIdPipelineStage.js"; import VertexAttributeSemantic from "../VertexAttributeSemantic.js"; +import Buffer from "../../Renderer/Buffer.js"; +import BufferUsage from "../../Renderer/BufferUsage.js"; + /** * The geometry pipeline stage processes the vertex attributes of a primitive. * @@ -132,6 +135,52 @@ GeometryPipelineStage.process = function ( ); } + if (primitive.primitiveType === PrimitiveType.POINTS) { + const gaussianSplatsEnabled = + (primitive?.isGaussianSplatPrimitive ?? false) && + model.enableShowGaussianSplatting; + if (gaussianSplatsEnabled) { + const showSplats = model.showGaussianSplatting; + primitive.attributes.find((a) => a.name === "POSITION").instanceDivisor = + showSplats ? 1 : 0; + primitive.attributes.find((a) => a.name === "_SCALE").instanceDivisor = + showSplats ? 1 : 0; + primitive.attributes.find((a) => a.name === "_ROTATION").instanceDivisor = + showSplats ? 1 : 0; + primitive.attributes.find((a) => a.name === "COLOR_0").instanceDivisor = + showSplats ? 1 : 0; + + if (primitive.hasGaussianSplatTexture) { + primitive.attributes.find( + (a) => a.name === "_SPLAT_INDEXES", + ).instanceDivisor = showSplats ? 1 : 0; + } + + if (!showSplats) { + shaderBuilder.addDefine("PRIMITIVE_TYPE_POINTS"); + + for (const name in primitive.attributes) { + if ( + primitive.attributes.hasOwnProperty(name) && + defined(primitive.attributes[name]) + ) { + const attribute = primitive.attributes[name]; + const vertexBuffer = Buffer.createVertexBuffer({ + context: frameState.context, + typedArray: attribute.typedArray, + usage: BufferUsage.DYNAMIC_DRAW, + }); + + vertexBuffer.vertexArrayDestroyable = false; + attribute.buffer = vertexBuffer; + } + } + } + } else { + shaderBuilder.addDefine("PRIMITIVE_TYPE_POINTS"); + } + } + // Attributes, structs, and functions will need to be modified for 2D / CV. const use2D = frameState.mode !== SceneMode.SCENE3D && @@ -186,10 +235,6 @@ GeometryPipelineStage.process = function ( handleBitangents(shaderBuilder, primitive.attributes); - if (primitive.primitiveType === PrimitiveType.POINTS) { - shaderBuilder.addDefine("PRIMITIVE_TYPE_POINTS"); - } - shaderBuilder.addVertexLines(GeometryStageVS); shaderBuilder.addFragmentLines(GeometryStageFS); }; diff --git a/packages/engine/Source/Scene/Model/I3dmLoader.js b/packages/engine/Source/Scene/Model/I3dmLoader.js index 8328628bd150..0f9457624419 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 a1a6deb9a285..3b11475908d8 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 682d2904cd5d..f1c209285b93 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 97a01eded645..a2f466484ee4 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 577741aae74b..f251f3851d4e 100644 --- a/packages/engine/Source/Scene/Model/MaterialPipelineStage.js +++ b/packages/engine/Source/Scene/Model/MaterialPipelineStage.js @@ -12,8 +12,13 @@ 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 @@ -54,7 +59,7 @@ const MaterialPipelineStage = { MaterialPipelineStage.process = function ( renderResources, primitive, - frameState, + frameState ) { // gltf-pipeline automatically creates a default material so this will always // be defined. @@ -67,8 +72,11 @@ 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, @@ -77,7 +85,7 @@ MaterialPipelineStage.process = function ( defaultTexture, defaultNormalTexture, defaultEmissiveTexture, - disableTextures, + disableTextures ); if (defined(material.specularGlossiness)) { @@ -86,7 +94,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ); } else { if ( @@ -98,7 +106,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ); } if ( @@ -110,7 +118,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ); } if ( @@ -122,7 +130,7 @@ MaterialPipelineStage.process = function ( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ); } processMetallicRoughnessUniforms( @@ -130,14 +138,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. @@ -165,7 +173,7 @@ MaterialPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_DOUBLE_SIDED_MATERIAL", undefined, - ShaderDestination.BOTH, + ShaderDestination.BOTH ); } }; @@ -186,14 +194,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 @@ -201,7 +209,7 @@ function processTextureTransform( shaderBuilder.addUniform( "mat3", transformUniformName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap[transformUniformName] = function () { return textureReader.transform; @@ -224,14 +232,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 @@ -239,7 +247,7 @@ function processTextureScale( shaderBuilder.addUniform( "float", scaleUniformName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap[scaleUniformName] = function () { return textureReader.scale; @@ -263,13 +271,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); @@ -286,7 +294,7 @@ function processTexture( shaderBuilder.addDefine( texCoordDefine, texCoordVarying, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); // Some textures have matrix transforms (e.g. for texture atlases). Add those @@ -301,7 +309,7 @@ function processTexture( uniformMap, textureReader, uniformName, - defineName, + defineName ); } @@ -312,7 +320,7 @@ function processTexture( uniformMap, textureReader, uniformName, - defineName, + defineName ); } } @@ -324,10 +332,14 @@ function processMaterialUniforms( defaultTexture, defaultNormalTexture, defaultEmissiveTexture, - disableTextures, + disableTextures ) { - const { emissiveFactor, emissiveTexture, normalTexture, occlusionTexture } = - material; + const { + emissiveFactor, + emissiveTexture, + normalTexture, + occlusionTexture, + } = material; if ( defined(emissiveFactor) && @@ -336,7 +348,7 @@ function processMaterialUniforms( shaderBuilder.addUniform( "vec3", "u_emissiveFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_emissiveFactor = function () { return material.emissiveFactor; @@ -344,7 +356,7 @@ function processMaterialUniforms( shaderBuilder.addDefine( "HAS_EMISSIVE_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); if (defined(emissiveTexture) && !disableTextures) { @@ -354,7 +366,7 @@ function processMaterialUniforms( emissiveTexture, "u_emissiveTexture", "EMISSIVE", - defaultEmissiveTexture, + defaultEmissiveTexture ); } } @@ -366,7 +378,7 @@ function processMaterialUniforms( normalTexture, "u_normalTexture", "NORMAL", - defaultNormalTexture, + defaultNormalTexture ); } @@ -377,7 +389,7 @@ function processMaterialUniforms( occlusionTexture, "u_occlusionTexture", "OCCLUSION", - defaultTexture, + defaultTexture ); } } @@ -397,7 +409,7 @@ function processSpecularGlossinessUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ) { const { diffuseTexture, @@ -410,7 +422,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "USE_SPECULAR_GLOSSINESS", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); if (defined(diffuseTexture) && !disableTextures) { @@ -420,7 +432,7 @@ function processSpecularGlossinessUniforms( diffuseTexture, "u_diffuseTexture", "DIFFUSE", - defaultTexture, + defaultTexture ); } @@ -431,7 +443,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addUniform( "vec4", "u_diffuseFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_diffuseFactor = function () { return specularGlossiness.diffuseFactor; @@ -439,7 +451,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "HAS_DIFFUSE_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -450,7 +462,7 @@ function processSpecularGlossinessUniforms( specularGlossinessTexture, "u_specularGlossinessTexture", "SPECULAR_GLOSSINESS", - defaultTexture, + defaultTexture ); } @@ -458,13 +470,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; @@ -472,7 +484,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "HAS_LEGACY_SPECULAR_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -483,7 +495,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addUniform( "float", "u_glossinessFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_glossinessFactor = function () { return specularGlossiness.glossinessFactor; @@ -491,7 +503,7 @@ function processSpecularGlossinessUniforms( shaderBuilder.addDefine( "HAS_GLOSSINESS_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } } @@ -511,7 +523,7 @@ function processSpecularUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ) { const { specularTexture, @@ -523,7 +535,7 @@ function processSpecularUniforms( shaderBuilder.addDefine( "USE_SPECULAR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); if (defined(specularTexture) && !disableTextures) { @@ -533,7 +545,7 @@ function processSpecularUniforms( specularTexture, "u_specularTexture", "SPECULAR", - defaultTexture, + defaultTexture ); } @@ -544,7 +556,7 @@ function processSpecularUniforms( shaderBuilder.addUniform( "float", "u_specularFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_specularFactor = function () { return specular.specularFactor; @@ -552,7 +564,7 @@ function processSpecularUniforms( shaderBuilder.addDefine( "HAS_SPECULAR_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -563,7 +575,7 @@ function processSpecularUniforms( specularColorTexture, "u_specularColorTexture", "SPECULAR_COLOR", - defaultTexture, + defaultTexture ); } @@ -571,13 +583,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; @@ -585,7 +597,7 @@ function processSpecularUniforms( shaderBuilder.addDefine( "HAS_SPECULAR_COLOR_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } } @@ -607,15 +619,18 @@ 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) { @@ -625,7 +640,7 @@ function processAnisotropyUniforms( anisotropyTexture, "u_anisotropyTexture", "ANISOTROPY", - defaultTexture, + defaultTexture ); } @@ -639,7 +654,7 @@ function processAnisotropyUniforms( cosRotation, sinRotation, anisotropyStrength, - scratchAnisotropy, + scratchAnisotropy ); }; } @@ -659,7 +674,7 @@ function processClearcoatUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ) { const { clearcoatFactor, @@ -672,7 +687,7 @@ function processClearcoatUniforms( shaderBuilder.addDefine( "USE_CLEARCOAT", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); if ( @@ -682,7 +697,7 @@ function processClearcoatUniforms( shaderBuilder.addUniform( "float", "u_clearcoatFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_clearcoatFactor = function () { return clearcoat.clearcoatFactor; @@ -690,7 +705,7 @@ function processClearcoatUniforms( shaderBuilder.addDefine( "HAS_CLEARCOAT_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -701,7 +716,7 @@ function processClearcoatUniforms( clearcoatTexture, "u_clearcoatTexture", "CLEARCOAT", - defaultTexture, + defaultTexture ); } @@ -712,7 +727,7 @@ function processClearcoatUniforms( shaderBuilder.addUniform( "float", "u_clearcoatRoughnessFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_clearcoatRoughnessFactor = function () { return clearcoat.clearcoatRoughnessFactor; @@ -720,7 +735,7 @@ function processClearcoatUniforms( shaderBuilder.addDefine( "HAS_CLEARCOAT_ROUGHNESS_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -731,7 +746,7 @@ function processClearcoatUniforms( clearcoatRoughnessTexture, "u_clearcoatRoughnessTexture", "CLEARCOAT_ROUGHNESS", - defaultTexture, + defaultTexture ); } @@ -742,7 +757,7 @@ function processClearcoatUniforms( clearcoatNormalTexture, "u_clearcoatNormalTexture", "CLEARCOAT_NORMAL", - defaultTexture, + defaultTexture ); } } @@ -762,12 +777,12 @@ function processMetallicRoughnessUniforms( uniformMap, shaderBuilder, defaultTexture, - disableTextures, + disableTextures ) { shaderBuilder.addDefine( "USE_METALLIC_ROUGHNESS", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); const baseColorTexture = metallicRoughness.baseColorTexture; @@ -778,7 +793,7 @@ function processMetallicRoughnessUniforms( baseColorTexture, "u_baseColorTexture", "BASE_COLOR", - defaultTexture, + defaultTexture ); } @@ -787,13 +802,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; @@ -801,7 +816,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addDefine( "HAS_BASE_COLOR_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -813,7 +828,7 @@ function processMetallicRoughnessUniforms( metallicRoughnessTexture, "u_metallicRoughnessTexture", "METALLIC_ROUGHNESS", - defaultTexture, + defaultTexture ); } @@ -825,7 +840,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addUniform( "float", "u_metallicFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_metallicFactor = function () { return metallicRoughness.metallicFactor; @@ -833,7 +848,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addDefine( "HAS_METALLIC_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -845,7 +860,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addUniform( "float", "u_roughnessFactor", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap.u_roughnessFactor = function () { return metallicRoughness.roughnessFactor; @@ -853,7 +868,7 @@ function processMetallicRoughnessUniforms( shaderBuilder.addDefine( "HAS_ROUGHNESS_FACTOR", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } } diff --git a/packages/engine/Source/Scene/Model/MetadataPickingPipelineStage.js b/packages/engine/Source/Scene/Model/MetadataPickingPipelineStage.js index 9603652b2f4e..3b4ad3e757b8 100644 --- a/packages/engine/Source/Scene/Model/MetadataPickingPipelineStage.js +++ b/packages/engine/Source/Scene/Model/MetadataPickingPipelineStage.js @@ -39,45 +39,45 @@ const MetadataPickingPipelineStage = { MetadataPickingPipelineStage.process = function ( renderResources, primitive, - frameState, + frameState ) { const shaderBuilder = renderResources.shaderBuilder; shaderBuilder.addDefine( MetadataPickingPipelineStage.METADATA_PICKING_VALUE_TYPE, "float", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addDefine( MetadataPickingPipelineStage.METADATA_PICKING_VALUE_STRING, "0.0", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addDefine( MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_X, "0.0", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addDefine( MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_Y, "0.0", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addDefine( MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_Z, "0.0", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addDefine( MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_W, "0.0", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addFunction( "metadataPickingStage", "void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)", - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addFunctionLines( @@ -89,7 +89,7 @@ MetadataPickingPipelineStage.process = function ( `metadataValues.z = ${MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_Z};`, `metadataValues.w = ${MetadataPickingPipelineStage.METADATA_PICKING_VALUE_COMPONENT_W};`, ], - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); }; diff --git a/packages/engine/Source/Scene/Model/MetadataPipelineStage.js b/packages/engine/Source/Scene/Model/MetadataPipelineStage.js index e0e293c2788a..01bcde68b202 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,8 +143,11 @@ 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]; @@ -184,7 +187,7 @@ function getPropertyTexturesInfo(propertyTextures, statistics) { return []; } return propertyTextures.flatMap((propertyTexture) => - getPropertyTextureInfo(propertyTexture, statistics), + getPropertyTextureInfo(propertyTexture, statistics) ); } @@ -201,9 +204,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++) { @@ -296,36 +299,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 @@ -333,19 +336,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 ); } @@ -385,23 +388,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] ); } @@ -428,8 +431,13 @@ 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 @@ -438,7 +446,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { shaderBuilder.addUniform( "sampler2D", textureUniformName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap[textureUniformName] = () => texture; } @@ -446,7 +454,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. @@ -461,7 +469,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { shaderBuilder.addUniform( "mat3", transformUniformName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); uniformMap[transformUniformName] = function () { return transform; @@ -491,7 +499,7 @@ function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) { const initializationLine = `metadata.${metadataVariable} = ${transformedValue};`; shaderBuilder.addFunctionLines( MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS, - [initializationLine], + [initializationLine] ); } @@ -512,7 +520,7 @@ function addPropertyMetadataClass(shaderBuilder, propertyInfo) { MetadataPipelineStage.METADATA_CLASS_FIELDS, classProperty, `metadataClass.${metadataVariable}`, - glslType, + glslType ); // Struct field: Prefix to get the appropriate <type>MetadataClass struct @@ -520,11 +528,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; @@ -532,11 +540,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 ); } @@ -566,7 +574,7 @@ function addPropertyMetadataStatistics(shaderBuilder, propertyInfo) { fields, propertyStatistics, struct, - glslType, + glslType ); // Struct field: Prefix to get the appropriate <type>MetadataStatistics struct @@ -574,11 +582,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; @@ -586,11 +594,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 15474e5df2ea..0fcf5635547a 100644 --- a/packages/engine/Source/Scene/Model/Model.js +++ b/packages/engine/Source/Scene/Model/Model.js @@ -15,6 +15,7 @@ import Matrix3 from "../../Core/Matrix3.js"; import Matrix4 from "../../Core/Matrix4.js"; import Resource from "../../Core/Resource.js"; import RuntimeError from "../../Core/RuntimeError.js"; +import CesiumMath from "../../Core/Math.js"; import Pass from "../../Renderer/Pass.js"; import ClippingPlaneCollection from "../ClippingPlaneCollection.js"; import ClippingPolygonCollection from "../ClippingPolygonCollection.js"; @@ -43,6 +44,9 @@ import PntsLoader from "./PntsLoader.js"; import StyleCommandsNeeded from "./StyleCommandsNeeded.js"; import pickModel from "./pickModel.js"; +import GaussianSplatSorter from "../GaussianSplatSorter.js"; +//import Buffer from "../../Renderer/Buffer.js"; +//import BufferUsage from "../../Renderer/BufferUsage.js"; /** * <div class="notice"> * To construct a Model, call {@link Model.fromGltfAsync}. Do not call the constructor directly. @@ -467,6 +471,24 @@ function Model(options) { */ this.showOutline = defaultValue(options.showOutline, true); + this._enableShowGaussianSplatting = defaultValue( + options.enableShowGaussianSplatting, + true, + ); + + /** + * Whether to display Gaussing Splatting (will fall back to point cloud rendering if false) + * + * @type {boolean} + */ + this.showGaussianSplatting = defaultValue( + options.showGaussianSplatting, + true, + ); + + //track last camera view to determine if gaussian splats need to be re-sorted + this._previousViewProj = undefined; + /** * The color to use when rendering outlines. * @@ -798,6 +820,36 @@ Object.defineProperties(Model.prototype, { }, }, + /** + * + * {@link Cesium3DTileset}. + * + * @memberof Model.prototype + * + * @type {PointCloudShading} + */ + enableShowGaussianSplatting: { + get: function () { + return this._enableShowGaussianSplatting; + }, + set: function (value) { + if (value !== this._enableShowGaussianSplatting) { + this.resetDrawCommands(); + } + this._enableShowGaussianSplatting = value; + // Warning for improper setup of gaussian splatting + if ( + this._enableShowGaussianSplatting === true || + this.type !== ModelType.GLTF + ) { + oneTimeWarning( + "model-enable-show-gaussian-splatting-ignored", + "enableShowGaussian splatting must be used with a glTF model that has the KHR_gaussian_splatting extension", + ); + } + }, + }, + /** * The model's custom shader, if it exists. Using custom shaders with a {@link Cesium3DTileStyle} * may lead to undefined behavior. @@ -1914,6 +1966,7 @@ Model.prototype.update = function (frameState) { updateSceneMode(this, frameState); updateFog(this, frameState); updateVerticalExaggeration(this, frameState); + updateGaussianSplatting(this, frameState); this._defaultTexture = frameState.context.defaultTexture; @@ -2062,6 +2115,75 @@ function updatePointCloudShading(model) { } } +function updateGaussianSplatting(model, frameState) { + //if the camera has rotated enough, update commands + const viewProj = new Matrix4(); + Matrix4.multiply( + frameState.camera.frustum.projectionMatrix, + frameState.camera.viewMatrix, + viewProj, + ); + + if (model._previousViewProj === undefined) { + model._previousViewProj = viewProj; + return; + } + + const sg = model._sceneGraph; + const prim = sg._components.nodes[0].primitives[0]; //walk more primitives + //texture generation is done and we have one ready to use + //rebuild our draw commands this one time + if (prim.gaussianSplatTexturePending && prim.hasGaussianSplatTexture) { + prim.gaussianSplatTexturePending = false; + model.resetDrawCommands(); + } + + const dot = + model._previousViewProj[2] * viewProj[2] + + model._previousViewProj[6] * viewProj[6] + + model._previousViewProj[10] * viewProj[10]; + + if (Math.abs(dot - 1) > CesiumMath.EPSILON2) { + if (prim?.isGaussianSplatPrimitive ?? false) { + const idxAttr = prim.attributes.find((a) => a.name === "_SPLAT_INDEXES"); + const posAttr = prim.attributes.find((a) => a.name === "POSITION"); + + const modelView = new Matrix4(); + Matrix4.multiply( + frameState.camera.viewMatrix, + model.modelMatrix, + modelView, + ); + try { + const promise = GaussianSplatSorter.radixSortIndexes({ + primitive: { + positions: new Float32Array(posAttr.typedArray), + modelView: Float32Array.from(modelView), + count: idxAttr.count, + }, + sortType: "Index", + }); + + if (promise === undefined) { + return; + } + + promise.catch((err) => { + console.error(`${err}`); + }); + promise.then((sortedData) => { + idxAttr.typedArray = sortedData; + model.resetDrawCommands(); + }); + } catch (e) { + console.log(`${e}`); + } + } + //model.resetDrawCommands(); + model._previousViewProj = viewProj; + } +} + function updateSilhouette(model, frameState) { if (model._silhouetteDirty) { // Only rebuild draw commands if silhouettes are supported in the first place. @@ -2964,6 +3086,7 @@ Model.fromGltfAsync = async function (options) { loadIndicesForWireframe: options.enableDebugWireframe, loadPrimitiveOutline: options.enableShowOutline, loadForClassification: defined(options.classificationType), + loadGaussianSplatting: options.enableShowGaussianSplatting, }; const basePath = defaultValue(options.basePath, ""); @@ -3235,6 +3358,7 @@ function makeModelOptions(loader, modelType, options) { pointCloudShading: options.pointCloudShading, classificationType: options.classificationType, pickObject: options.pickObject, + showGaussianSplatting: options.showGaussianSplatting, }; } diff --git a/packages/engine/Source/Scene/Model/Model3DTileContent.js b/packages/engine/Source/Scene/Model/Model3DTileContent.js index bdc0b3831a81..33782da132f5 100644 --- a/packages/engine/Source/Scene/Model/Model3DTileContent.js +++ b/packages/engine/Source/Scene/Model/Model3DTileContent.js @@ -516,6 +516,7 @@ function makeModelOptions(tileset, tile, content, additionalOptions) { enableShowOutline: tileset._enableShowOutline, showOutline: tileset.showOutline, outlineColor: tileset.outlineColor, + showGaussianSplatting: tileset.showGaussianSplatting, }; return combine(additionalOptions, mainOptions); diff --git a/packages/engine/Source/Scene/Model/ModelAnimationChannel.js b/packages/engine/Source/Scene/Model/ModelAnimationChannel.js index 9dbb92a00b5c..b8f8e0ea4fca 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 3c441c0aa94f..d3d18aaccf72 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 bc3f745d9d6d..401be000165b 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 772c03966732..e0805f8aa651 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 f9107a4a9f70..8d9945f244d4 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 56e9d25c6c8b..c9eb597140c7 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 04a026f1d140..fc9c26284962 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,19 +79,20 @@ 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 4bbc2a841aca..83323fc1ec7d 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/ModelDrawCommands.js b/packages/engine/Source/Scene/Model/ModelDrawCommands.js index 7d609ac36c82..7714d58c42dd 100644 --- a/packages/engine/Source/Scene/Model/ModelDrawCommands.js +++ b/packages/engine/Source/Scene/Model/ModelDrawCommands.js @@ -24,6 +24,11 @@ import DeveloperError from "../../Core/DeveloperError.js"; */ function ModelDrawCommands() {} +import Geometry from "../../Core/Geometry.js"; +import GeometryAttribute from "../../Core/GeometryAttribute.js"; +import ComponentDatatype from "../../Core/ComponentDatatype.js"; +import PrimitiveType from "../../Core/PrimitiveType.js"; +import BufferUsage from "../../Renderer/BufferUsage.js"; /** * Builds the {@link ModelDrawCommand} for a {@link ModelRuntimePrimitive} * using its render resources. If the model classifies another asset, it @@ -46,11 +51,18 @@ ModelDrawCommands.buildModelDrawCommand = function ( frameState, ); - const command = buildDrawCommandForModel( - primitiveRenderResources, - shaderProgram, - frameState, - ); + const command = primitiveRenderResources.runtimePrimitive.primitive + .isGaussianSplatPrimitive + ? buildDrawCommandForGaussianSplatPrimitive( + primitiveRenderResources, + shaderProgram, + frameState, + ) + : buildDrawCommandForModel( + primitiveRenderResources, + shaderProgram, + frameState, + ); const model = primitiveRenderResources.model; const hasClassification = defined(model.classificationType); @@ -103,6 +115,7 @@ function buildDrawCommandForModel( frameState, ) { const indexBuffer = getIndexBuffer(primitiveRenderResources); + const model = primitiveRenderResources.model; const vertexArray = new VertexArray({ context: frameState.context, @@ -110,7 +123,193 @@ function buildDrawCommandForModel( attributes: primitiveRenderResources.attributes, }); + model._pipelineResources.push(vertexArray); + + const pass = primitiveRenderResources.alphaOptions.pass; + const sceneGraph = model.sceneGraph; + + const is3D = frameState.mode === SceneMode.SCENE3D; + let modelMatrix, boundingSphere; + + if (!is3D && !frameState.scene3DOnly && model._projectTo2D) { + modelMatrix = Matrix4.multiplyTransformation( + sceneGraph._computedModelMatrix, + primitiveRenderResources.runtimeNode.computedTransform, + new Matrix4(), + ); + + const runtimePrimitive = primitiveRenderResources.runtimePrimitive; + boundingSphere = runtimePrimitive.boundingSphere2D; + } else { + const computedModelMatrix = is3D + ? sceneGraph._computedModelMatrix + : sceneGraph._computedModelMatrix2D; + + modelMatrix = Matrix4.multiplyTransformation( + computedModelMatrix, + primitiveRenderResources.runtimeNode.computedTransform, + new Matrix4(), + ); + + boundingSphere = BoundingSphere.transform( + primitiveRenderResources.boundingSphere, + modelMatrix, + ); + } + + // Initialize render state with default values + let renderState = clone( + RenderState.fromCache(primitiveRenderResources.renderStateOptions), + true, + ); + + renderState.cull.face = ModelUtility.getCullFace( + modelMatrix, + primitiveRenderResources.primitiveType, + ); + renderState = RenderState.fromCache(renderState); + + const hasClassification = defined(model.classificationType); + const castShadows = hasClassification + ? false + : ShadowMode.castShadows(model.shadows); + const receiveShadows = hasClassification + ? false + : ShadowMode.receiveShadows(model.shadows); + // Pick IDs are only added to specific draw commands for classification. + // This behavior is handled by ClassificationModelDrawCommand. + const pickId = hasClassification + ? undefined + : primitiveRenderResources.pickId; + + const command = new DrawCommand({ + boundingVolume: boundingSphere, + modelMatrix: modelMatrix, + uniformMap: primitiveRenderResources.uniformMap, + renderState: renderState, + vertexArray: vertexArray, + shaderProgram: shaderProgram, + cull: model.cull, + pass: pass, + count: primitiveRenderResources.count, + owner: model, + pickId: pickId, + pickMetadataAllowed: true, + instanceCount: primitiveRenderResources.instanceCount, + primitiveType: primitiveRenderResources.primitiveType, + debugShowBoundingVolume: model.debugShowBoundingVolume, + castShadows: castShadows, + receiveShadows: receiveShadows, + }); + return command; +} + +/** + * Builds the {@link DrawCommand} that serves as the basis for either creating + * a {@link ModelDrawCommand} or a {@link ModelRuntimePrimitive} + * + * @param {PrimitiveRenderResources} primitiveRenderResources The render resources for a primitive. + * @param {ShaderProgram} shaderProgram The shader program + * @param {FrameState} frameState The frame state for creating GPU resources. + * + * @returns {DrawCommand} The generated DrawCommand, to be passed to + * the ModelDrawCommand or ClassificationModelDrawCommand + * + * @private + */ +function buildDrawCommandForGaussianSplatPrimitive( + primitiveRenderResources, + shaderProgram, + frameState, +) { + const indexBuffer = getIndexBuffer(primitiveRenderResources); const model = primitiveRenderResources.model; + + const vertexArray = (() => { + if ( + !( + primitiveRenderResources.runtimePrimitive.primitive + ?.hasGaussianSplatTexture ?? false + ) + ) { + const splatQuadAttrLocations = { + 0: 9, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + splatPosition: 7, + splatColor: 8, + }; + const geometry = new Geometry({ + attributes: { + screenQuadPosition: new GeometryAttribute({ + componentDatatype: ComponentDatatype.FLOAT, + componentsPerAttribute: 2, + values: [-2, -2, 2, -2, 2, 2, -2, 2], + name: "_SCREEN_QUAD_POS", + variableName: "screenQuadPos", + }), + ...primitiveRenderResources.runtimePrimitive.primitive.attributes, + splatPosition: { + ...primitiveRenderResources.runtimePrimitive.primitive.attributes.find( + (a) => a.name === "POSITION", + ), + name: "_SPLAT_POSITION", + variableName: "splatPosition", + }, + splatColor: { + ...primitiveRenderResources.runtimePrimitive.primitive.attributes.find( + (a) => a.name === "COLOR_0", + ), + name: "_SPLAT_COLOR", + variableName: "splatColor", + }, + }, + indices: indexBuffer, + primitiveType: PrimitiveType.TRIANGLE_STRIP, + }); + + return VertexArray.fromGeometry({ + context: frameState.context, + geometry: geometry, + attributeLocations: splatQuadAttrLocations, + bufferUsage: BufferUsage.STATIC_DRAW, + interleave: false, + }); + } + const splatQuadAttrLocations = { + 5: 5, + splatIndex: 7, + }; + const geometry = new Geometry({ + attributes: { + screenQuadPosition: new GeometryAttribute({ + componentDatatype: ComponentDatatype.FLOAT, + componentsPerAttribute: 2, + values: [-1, -1, 1, -1, 1, 1, -1, 1], + name: "_SCREEN_QUAD_POS", + variableName: "screenQuadPosition", + }), + splatIndex: { + ...primitiveRenderResources.runtimePrimitive.primitive.attributes.find( + (a) => a.name === "_SPLAT_INDEXES", + ), + }, + }, + indices: indexBuffer, + primitiveType: PrimitiveType.TRIANGLE_STRIP, + }); + + return VertexArray.fromGeometry({ + context: frameState.context, + geometry: geometry, + attributeLocations: splatQuadAttrLocations, + bufferUsage: BufferUsage.STATIC_DRAW, + interleave: false, + }); + })(); + model._pipelineResources.push(vertexArray); const pass = primitiveRenderResources.alphaOptions.pass; diff --git a/packages/engine/Source/Scene/Model/ModelFeatureTable.js b/packages/engine/Source/Scene/Model/ModelFeatureTable.js index dff95e0582e8..1a18a39029d8 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 dbc23e758d6b..6ad9b7b63c20 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,11 +57,11 @@ function updateDrawCommand(drawCommand, modelMatrix, transformToRoot) { drawCommand.modelMatrix = Matrix4.multiplyTransformation( modelMatrix, transformToRoot, - drawCommand.modelMatrix, + drawCommand.modelMatrix ); drawCommand.cullFace = ModelUtility.getCullFace( drawCommand.modelMatrix, - drawCommand.primitiveType, + drawCommand.primitiveType ); } @@ -74,7 +74,7 @@ function updateRuntimeNode( runtimeNode, sceneGraph, modelMatrix, - transformToRoot, + transformToRoot ) { let i; @@ -82,7 +82,7 @@ function updateRuntimeNode( transformToRoot = Matrix4.multiplyTransformation( transformToRoot, runtimeNode.transform, - new Matrix4(), + new Matrix4() ); runtimeNode.updateComputedTransform(); @@ -93,7 +93,7 @@ function updateRuntimeNode( updateDrawCommand( runtimePrimitive.drawCommand, modelMatrix, - transformToRoot, + transformToRoot ); } @@ -104,14 +104,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 5cab3dc11504..e3f7610bd852 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 a45a3078304e..ac1eba5e805f 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 dca730224b55..9f1d5b4f7931 100644 --- a/packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js +++ b/packages/engine/Source/Scene/Model/ModelRuntimePrimitive.js @@ -27,6 +27,8 @@ import SelectedFeatureIdPipelineStage from "./SelectedFeatureIdPipelineStage.js" import SkinningPipelineStage from "./SkinningPipelineStage.js"; import VerticalExaggerationPipelineStage from "./VerticalExaggerationPipelineStage.js"; import WireframePipelineStage from "./WireframePipelineStage.js"; +import GaussianSplatPipelineStage from "./GaussianSplatPipelineStage.js"; +import GaussianSplatTexturePipelineStage from "./GaussianSplatTexturePipelineStage.js"; /** * In memory representation of a single primitive, that is, a primitive @@ -215,6 +217,7 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) { const hasQuantization = ModelUtility.hasQuantizedAttributes( primitive.attributes, ); + const generateWireframeIndices = model.debugWireframe && PrimitiveType.isTriangles(primitive.primitiveType) && @@ -239,6 +242,13 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) { const hasClassification = defined(model.classificationType); + // const hasGaussianSplats = + // model.enableShowGaussianSplatting + // && model.showGaussianSplatting + // && (primitive?.isGaussianSplatPrimitive ?? false); + const hasGaussianSplats = + model.showGaussianSplatting && + (primitive?.isGaussianSplatPrimitive ?? false); // Start of pipeline ----------------------------------------------------- if (use2D) { pipelineStages.push(SceneMode2DPipelineStage); @@ -308,6 +318,14 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) { pipelineStages.push(PrimitiveStatisticsPipelineStage); + if (hasGaussianSplats) { + if (primitive?.hasGaussianSplatTexture ?? false) { + pipelineStages.push(GaussianSplatTexturePipelineStage); + } else { + pipelineStages.push(GaussianSplatPipelineStage); + } + } + return; }; diff --git a/packages/engine/Source/Scene/Model/ModelSceneGraph.js b/packages/engine/Source/Scene/Model/ModelSceneGraph.js index 11e3918c0589..29fb80b9279d 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 = ModelDrawCommands.buildModelDrawCommand( 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); @@ -943,7 +943,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 2a7a0116d9c6..abcdee908fc0 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 2a62ef61dcfb..72f7dca5549c 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 5d8130537807..909e9c5452d6 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,16 +49,17 @@ 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 a117a878b10f..0c35a187d34b 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 ); } @@ -364,6 +364,7 @@ ModelUtility.supportedExtensions = { KHR_mesh_quantization: true, KHR_texture_basisu: true, KHR_texture_transform: true, + KHR_gaussian_splatting: true, WEB3D_quantized_attributes: true, }; diff --git a/packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js b/packages/engine/Source/Scene/Model/MorphTargetsPipelineStage.js index 2e34fa1776d1..01f13db68c0e 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 8c3d485850b7..aa908ffaee85 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 acb633bfe64a..11cef8855abf 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 76563792d191..166f71e814f8 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 fafb851851c4..2565dd01a420 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 967e07fcfe98..9abb174126d3 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,11 +81,12 @@ 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); @@ -94,19 +95,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. @@ -121,7 +122,7 @@ PointCloudStylingPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_POINT_CLOUD_ATTENUATION", undefined, - ShaderDestination.VERTEX, + ShaderDestination.VERTEX ); } @@ -129,7 +130,7 @@ PointCloudStylingPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_POINT_CLOUD_BACK_FACE_CULLING", undefined, - ShaderDestination.VERTEX, + ShaderDestination.VERTEX ); } @@ -146,7 +147,7 @@ PointCloudStylingPipelineStage.process = function ( shaderBuilder.addUniform( "vec4", "model_pointCloudParameters", - ShaderDestination.VERTEX, + ShaderDestination.VERTEX ); shaderBuilder.addVertexLines(PointCloudStylingStageVS); @@ -164,7 +165,7 @@ PointCloudStylingPipelineStage.process = function ( } vec4.x = defaultValue( pointCloudShading.maximumAttenuation, - defaultPointSize, + defaultPointSize ); vec4.x *= frameState.pixelRatio; @@ -173,7 +174,7 @@ PointCloudStylingPipelineStage.process = function ( renderResources, primitive, pointCloudShading, - content, + content ); vec4.y = geometricError * pointCloudShading.geometricErrorScale; @@ -209,7 +210,7 @@ function getGeometricError( renderResources, primitive, pointCloudShading, - content, + content ) { if (defined(content)) { const geometricError = content.tile.geometricError; @@ -225,7 +226,7 @@ function getGeometricError( const positionAttribute = ModelUtility.getAttributeBySemantic( primitive, - VertexAttributeSemantic.POSITION, + VertexAttributeSemantic.POSITION ); const pointsLength = positionAttribute.count; @@ -234,13 +235,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); @@ -295,17 +296,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; @@ -319,7 +320,7 @@ function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) { shaderBuilder.addDefine( "HAS_POINT_CLOUD_COLOR_STYLE", undefined, - ShaderDestination.BOTH, + ShaderDestination.BOTH ); shaderBuilder.addVertexLines(colorStyleFunction); @@ -333,7 +334,7 @@ function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) { shaderBuilder.addDefine( "HAS_POINT_CLOUD_SHOW_STYLE", undefined, - ShaderDestination.VERTEX, + ShaderDestination.VERTEX ); shaderBuilder.addVertexLines(showStyleFunction); } @@ -343,7 +344,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 d21e59662b7c..2e6e73a2cfe6 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 f51803984b32..23b9b034896f 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 b354b9b51958..ce24f71f05ce 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 d01e85df5efd..2b872c6fb61e 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 d870ca0518d4..8f4856c0c719 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 6a95e14384c3..df30ad52509f 100644 --- a/packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js +++ b/packages/engine/Source/Scene/Model/SelectedFeatureIdPipelineStage.js @@ -33,7 +33,7 @@ const SelectedFeatureIdPipelineStage = { SelectedFeatureIdPipelineStage.process = function ( renderResources, primitive, - frameState, + frameState ) { const shaderBuilder = renderResources.shaderBuilder; @@ -47,7 +47,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_SELECTED_FEATURE_ID", undefined, - shaderDestination, + shaderDestination ); // Add a define to insert the variable to use. @@ -56,7 +56,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 @@ -65,7 +65,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( selectedFeatureIds.featureIdDefine, undefined, - shaderDestination, + shaderDestination ); updateFeatureStruct(shaderBuilder); @@ -76,7 +76,7 @@ SelectedFeatureIdPipelineStage.process = function ( shaderBuilder.addDefine( "HAS_NULL_FEATURE_ID", undefined, - shaderDestination, + shaderDestination ); shaderBuilder.addUniform("int", "model_nullFeatureId", shaderDestination); uniformMap.model_nullFeatureId = function () { @@ -115,7 +115,7 @@ function getSelectedFeatureIds(model, node, primitive) { if (defined(node.instances)) { featureIds = ModelUtility.getFeatureIdsByLabel( node.instances.featureIds, - model.instanceFeatureIdLabel, + model.instanceFeatureIdLabel ); if (defined(featureIds)) { @@ -133,7 +133,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); @@ -162,19 +162,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 4475a35c3e07..0f7fc1b84fdc 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 c5e1188d1fd7..a673bbf3b1bc 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 683ebaee443d..fb13fda62919 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 a8b6db4b2483..ef0b4b809806 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 33dd3718b2de..7a3257ff6869 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 9dd8aa83a3fa..19f26b1001d3 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 0461597b12fe..7aed34818ea6 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/pickModel.js b/packages/engine/Source/Scene/Model/pickModel.js index 244ea0e3b45f..9dc7cc768be4 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 fc72bf5baac6..3f3a88ed86b8 100644 --- a/packages/engine/Source/Scene/ModelComponents.js +++ b/packages/engine/Source/Scene/ModelComponents.js @@ -1246,7 +1246,7 @@ function MetallicRoughness() { * @private */ this.baseColorFactor = Cartesian4.clone( - MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR, + MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR ); /** @@ -1316,7 +1316,7 @@ function SpecularGlossiness() { * @private */ this.diffuseFactor = Cartesian4.clone( - SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR, + SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR ); /** @@ -1327,7 +1327,7 @@ function SpecularGlossiness() { * @private */ this.specularFactor = Cartesian3.clone( - SpecularGlossiness.DEFAULT_SPECULAR_FACTOR, + SpecularGlossiness.DEFAULT_SPECULAR_FACTOR ); /** @@ -1381,7 +1381,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 879eed33117a..aef70fb880b3 100644 --- a/packages/engine/Source/Scene/Moon.js +++ b/packages/engine/Source/Scene/Moon.js @@ -116,17 +116,16 @@ 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 ddf096d8979f..42ede698a349 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,8 +328,7 @@ 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) { @@ -367,8 +366,7 @@ 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; } @@ -383,7 +381,7 @@ Multiple3DTileContent.prototype.requestInnerContents = function () { this, i, originalCancelCount, - this._tile._contentState, + this._tile._contentState ); } @@ -422,12 +420,13 @@ 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 @@ -497,7 +496,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 @@ -520,7 +519,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" ); } @@ -542,13 +541,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 572120d40510..8fe326e758c2 100644 --- a/packages/engine/Source/Scene/OIT.js +++ b/packages/engine/Source/Scene/OIT.js @@ -238,7 +238,7 @@ OIT.prototype.update = function ( passState, framebuffer, useHDR, - numSamples, + numSamples ) { if (!this.isSupported()) { return; @@ -365,7 +365,7 @@ OIT.prototype.update = function ( const useScissorTest = !BoundingRectangle.equals( this._viewport, - passState.viewport, + passState.viewport ); let updateScissor = useScissorTest !== this._useScissorTest; this._useScissorTest = useScissorTest; @@ -373,7 +373,7 @@ OIT.prototype.update = function ( if (!BoundingRectangle.equals(this._scissorRectangle, passState.viewport)) { this._scissorRectangle = BoundingRectangle.clone( passState.viewport, - this._scissorRectangle, + this._scissorRectangle ); updateScissor = true; } @@ -442,7 +442,7 @@ function getTranslucentRenderState( context, translucentBlending, cache, - renderState, + renderState ) { let translucentState = cache[renderState.id]; if (!defined(translucentState)) { @@ -462,7 +462,7 @@ function getTranslucentMRTRenderState(oit, context, renderState) { context, translucentMRTBlend, oit._translucentRenderStateCache, - renderState, + renderState ); } @@ -471,7 +471,7 @@ function getTranslucentColorRenderState(oit, context, renderState) { context, translucentColorBlend, oit._translucentRenderStateCache, - renderState, + renderState ); } @@ -480,7 +480,7 @@ function getTranslucentAlphaRenderState(oit, context, renderState) { context, translucentAlphaBlend, oit._alphaRenderStateCache, - renderState, + renderState ); } @@ -523,7 +523,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"); @@ -534,7 +534,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)]; @@ -554,7 +554,7 @@ function getTranslucentShaderProgram(context, shaderProgram, keyword, source) { " {\n" + " discard;\n" + " }\n" - }${source}}\n`, + }${source}}\n` ); return shaderCache.createDerivedShaderProgram(shaderProgram, keyword, { @@ -569,7 +569,7 @@ function getTranslucentMRTShaderProgram(context, shaderProgram) { context, shaderProgram, "translucentMRT", - mrtShaderSource, + mrtShaderSource ); } @@ -578,7 +578,7 @@ function getTranslucentColorShaderProgram(context, shaderProgram) { context, shaderProgram, "translucentMultipass", - colorShaderSource, + colorShaderSource ); } @@ -587,7 +587,7 @@ function getTranslucentAlphaShaderProgram(context, shaderProgram) { context, shaderProgram, "alphaMultipass", - alphaShaderSource, + alphaShaderSource ); } @@ -613,7 +613,7 @@ OIT.prototype.createDerivedCommands = function (command, context, result) { result.translucentCommand = DrawCommand.shallowClone( command, - result.translucentCommand, + result.translucentCommand ); if ( @@ -622,12 +622,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 { @@ -650,7 +650,7 @@ OIT.prototype.createDerivedCommands = function (command, context, result) { result.translucentCommand = DrawCommand.shallowClone( command, - result.translucentCommand, + result.translucentCommand ); result.alphaCommand = DrawCommand.shallowClone(command, result.alphaCommand); @@ -660,21 +660,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 { @@ -702,7 +702,7 @@ function executeTranslucentCommandsSortedMultipass( executeFunction, passState, commands, - invertClassification, + invertClassification ) { const { context, frameState } = scene; const { useLogDepth, shadowState } = frameState; @@ -779,7 +779,7 @@ function executeTranslucentCommandsSortedMRT( executeFunction, passState, commands, - invertClassification, + invertClassification ) { const { context, frameState } = scene; const { useLogDepth, shadowState } = frameState; @@ -830,7 +830,7 @@ OIT.prototype.executeCommands = function ( executeFunction, passState, commands, - invertClassification, + invertClassification ) { if (this._translucentMRTSupport) { executeTranslucentCommandsSortedMRT( @@ -839,7 +839,7 @@ OIT.prototype.executeCommands = function ( executeFunction, passState, commands, - invertClassification, + invertClassification ); return; } @@ -850,7 +850,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 a170c06aebc5..1ff19fded150 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,10 +119,9 @@ 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 74b5f9df50d8..f52d0cb95301 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 26f104eabaea..a304f03475eb 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 ef02d378f56e..c8a11276b80d 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 032755713956..7fab2c50d985 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 a896ddd43b12..a2a32ec136b9 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 726ccbc8a6f8..a29d9fe86c8b 100644 --- a/packages/engine/Source/Scene/PickDepth.js +++ b/packages/engine/Source/Scene/PickDepth.js @@ -54,7 +54,7 @@ void main() }, }, owner: pickDepth, - }, + } ); } @@ -72,7 +72,7 @@ const packedDepthScale = new Cartesian4( 1.0, 1.0 / 255.0, 1.0 / 65025.0, - 1.0 / 16581375.0, + 1.0 / 16581375.0 ); /** diff --git a/packages/engine/Source/Scene/PickDepthFramebuffer.js b/packages/engine/Source/Scene/PickDepthFramebuffer.js index 72ece64a45d2..3e22fe1f10a9 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 69645bb7cc50..80abd4284578 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 @@ -96,17 +96,17 @@ PickFramebuffer.prototype.end = function (screenSpaceRectangle) { colorScratchForPickFramebuffer.red = Color.byteToFloat(pixels[index]); colorScratchForPickFramebuffer.green = Color.byteToFloat( - pixels[index + 1], + pixels[index + 1] ); colorScratchForPickFramebuffer.blue = Color.byteToFloat( - pixels[index + 2], + pixels[index + 2] ); colorScratchForPickFramebuffer.alpha = Color.byteToFloat( - pixels[index + 3], + pixels[index + 3] ); const object = context.getObjectByPickColor( - colorScratchForPickFramebuffer, + colorScratchForPickFramebuffer ); if (defined(object)) { return object; diff --git a/packages/engine/Source/Scene/Picking.js b/packages/engine/Source/Scene/Picking.js index fc38a4a90955..1e2ab94fb48f 100644 --- a/packages/engine/Source/Scene/Picking.js +++ b/packages/engine/Source/Scene/Picking.js @@ -60,7 +60,7 @@ function Picking(scene) { this._pickOffscreenView = new View( scene, pickOffscreenCamera, - pickOffscreenViewport, + pickOffscreenViewport ); } @@ -89,7 +89,7 @@ function getPickOrthographicCullingVolume( drawingBufferPosition, width, height, - viewport, + viewport ) { const camera = scene.camera; let frustum = camera.frustum; @@ -108,7 +108,7 @@ function getPickOrthographicCullingVolume( const transform = Matrix4.clone( camera.transform, - scratchOrthoPickVolumeMatrix4, + scratchOrthoPickVolumeMatrix4 ); camera._setTransform(Matrix4.IDENTITY); @@ -129,7 +129,7 @@ function getPickOrthographicCullingVolume( viewport.height, 1.0, 1.0, - scratchOrthoPixelSize, + scratchOrthoPixelSize ); const ortho = scratchOrthoPickingFrustum; @@ -151,7 +151,7 @@ function getPickPerspectiveCullingVolume( drawingBufferPosition, width, height, - viewport, + viewport ) { const camera = scene.camera; const frustum = camera.frustum; @@ -175,7 +175,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; @@ -191,7 +191,7 @@ function getPickPerspectiveCullingVolume( return offCenter.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC, + camera.upWC ); } @@ -200,7 +200,7 @@ function getPickCullingVolume( drawingBufferPosition, width, height, - viewport, + viewport ) { const frustum = scene.camera.frustum; if ( @@ -212,7 +212,7 @@ function getPickCullingVolume( drawingBufferPosition, width, height, - viewport, + viewport ); } @@ -221,7 +221,7 @@ function getPickCullingVolume( drawingBufferPosition, width, height, - viewport, + viewport ); } @@ -253,7 +253,7 @@ function computePickingDrawingBufferRectangle( position, width, height, - result, + result ) { result.width = defaultValue(width, 3.0); result.height = defaultValue(height, result.width); @@ -296,14 +296,14 @@ Picking.prototype.pick = function (scene, windowPosition, width, height) { const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition, + scratchPosition ); const drawingBufferRectangle = computePickingDrawingBufferRectangle( context.drawingBufferHeight, drawingBufferPosition, width, height, - scratchRectangle, + scratchRectangle ); scene.jobScheduler.disableThisFrame(); @@ -314,7 +314,7 @@ Picking.prototype.pick = function (scene, windowPosition, width, height) { drawingBufferPosition, drawingBufferRectangle.width, drawingBufferRectangle.height, - viewport, + viewport ); frameState.invertClassification = false; frameState.passes.pick = true; @@ -349,7 +349,7 @@ Picking.prototype.pickVoxelCoordinate = function ( scene, windowPosition, width, - height, + height ) { //>>includeStart('debug', pragmas.debug); Check.defined("windowPosition", windowPosition); @@ -371,14 +371,14 @@ Picking.prototype.pickVoxelCoordinate = function ( const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition, + scratchPosition ); const drawingBufferRectangle = computePickingDrawingBufferRectangle( context.drawingBufferHeight, drawingBufferPosition, width, height, - scratchRectangle, + scratchRectangle ); scene.jobScheduler.disableThisFrame(); @@ -389,7 +389,7 @@ Picking.prototype.pickVoxelCoordinate = function ( drawingBufferPosition, drawingBufferRectangle.width, drawingBufferRectangle.height, - viewport, + viewport ); frameState.invertClassification = false; frameState.passes.pickVoxel = true; @@ -435,7 +435,7 @@ Picking.prototype.pickVoxelCoordinate = function ( Picking.prototype.pickMetadata = function ( scene, windowPosition, - pickedMetadataInfo, + pickedMetadataInfo ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("windowPosition", windowPosition); @@ -458,14 +458,14 @@ Picking.prototype.pickMetadata = function ( const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition, + scratchPosition ); const drawingBufferRectangle = computePickingDrawingBufferRectangle( context.drawingBufferHeight, drawingBufferPosition, 1.0, 1.0, - scratchRectangle, + scratchRectangle ); scene.jobScheduler.disableThisFrame(); @@ -476,7 +476,7 @@ Picking.prototype.pickMetadata = function ( drawingBufferPosition, drawingBufferRectangle.width, drawingBufferRectangle.height, - viewport, + viewport ); frameState.invertClassification = false; @@ -509,7 +509,7 @@ Picking.prototype.pickMetadata = function ( scene._environmentState.useOIT = oldOIT; const rawMetadataPixel = pickFramebuffer.readCenterPixel( - drawingBufferRectangle, + drawingBufferRectangle ); context.endFrame(); @@ -517,7 +517,7 @@ Picking.prototype.pickMetadata = function ( const metadataValue = MetadataPicking.decodeMetadataValues( pickedMetadataInfo.classProperty, - rawMetadataPixel, + rawMetadataPixel ); return metadataValue; @@ -557,7 +557,7 @@ function renderTranslucentDepthForPick(scene, drawingBufferPosition) { drawingBufferPosition, 1, 1, - viewport, + viewport ); frameState.tilesetPassState = pickTilesetPassState; @@ -566,7 +566,7 @@ function renderTranslucentDepthForPick(scene, drawingBufferPosition) { passState = pickDepthFramebuffer.update( context, drawingBufferPosition, - viewport, + viewport ); scene.updateAndExecuteCommands(passState, scratchColorZero); @@ -583,7 +583,7 @@ const scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum(); Picking.prototype.pickPositionWorldCoordinates = function ( scene, windowPosition, - result, + result ) { if (!scene.useDepthPicking) { return undefined; @@ -593,7 +593,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'); @@ -615,7 +615,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer( scene, windowPosition, - scratchPosition, + scratchPosition ); if (scene.pickTranslucentDepth) { renderTranslucentDepthForPick(scene, drawingBufferPosition); @@ -645,7 +645,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( const depth = pickDepth.getDepth( context, drawingBufferPosition.x, - drawingBufferPosition.y, + drawingBufferPosition.y ); if (!defined(depth)) { continue; @@ -672,7 +672,7 @@ Picking.prototype.pickPositionWorldCoordinates = function ( scene, drawingBufferPosition, depth, - result, + result ); if (scene.mode === SceneMode.SCENE2D) { @@ -753,7 +753,7 @@ function drillPick(limit, pickCallback) { hasShowAttribute = true; attributes.show = ShowGeometryInstanceAttribute.toValue( false, - attributes.show, + attributes.show ); pickedAttributes.push(attributes); } @@ -784,7 +784,7 @@ function drillPick(limit, pickCallback) { attributes = pickedAttributes[i]; attributes.show = ShowGeometryInstanceAttribute.toValue( true, - attributes.show, + attributes.show ); } @@ -800,7 +800,7 @@ Picking.prototype.drillPick = function ( windowPosition, limit, width, - height, + height ) { const that = this; const pickCallback = function () { @@ -850,7 +850,7 @@ function updateOffscreenCameraFromRay(picking, ray, width, camera) { return camera.frustum.computeCullingVolume( camera.positionWC, camera.directionWC, - camera.upWC, + camera.upWC ); } @@ -864,7 +864,7 @@ function updateMostDetailedRayPick(picking, scene, rayPick) { picking, ray, width, - camera, + camera ); const tilesetPassState = mostDetailedPreloadTilesetPassState; @@ -924,7 +924,7 @@ function launchMostDetailedRayPick( ray, objectsToExclude, width, - callback, + callback ) { const tilesets = []; getTilesets(scene.primitives, objectsToExclude, tilesets); @@ -961,7 +961,7 @@ function getRayIntersection( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ) { const { context, frameState } = scene; const uniformState = context.uniformState; @@ -973,12 +973,12 @@ function getRayIntersection( const drawingBufferRectangle = BoundingRectangle.clone( view.viewport, - scratchRectangle, + scratchRectangle ); const passState = view.pickFramebuffer.begin( drawingBufferRectangle, - view.viewport, + view.viewport ); scene.jobScheduler.disableThisFrame(); @@ -1047,7 +1047,7 @@ function getRayIntersections( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ) { const pickCallback = function () { return getRayIntersection( @@ -1057,7 +1057,7 @@ function getRayIntersections( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ); }; return drillPick(limit, pickCallback); @@ -1070,7 +1070,7 @@ function pickFromRay( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ) { const results = getRayIntersections( picking, @@ -1080,7 +1080,7 @@ function pickFromRay( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ); if (results.length > 0) { return results[0]; @@ -1095,7 +1095,7 @@ function drillPickFromRay( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ) { return getRayIntersections( picking, @@ -1105,7 +1105,7 @@ function drillPickFromRay( objectsToExclude, width, requirePosition, - mostDetailed, + mostDetailed ); } @@ -1132,7 +1132,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'); @@ -1145,13 +1145,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'); @@ -1164,7 +1164,7 @@ Picking.prototype.drillPickFromRay = function ( objectsToExclude, width, false, - false, + false ); }; @@ -1172,13 +1172,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'); @@ -1204,10 +1204,10 @@ Picking.prototype.pickFromRayMostDetailed = function ( objectsToExclude, width, false, - true, + true ); - }, - ), + } + ) ); }; @@ -1216,13 +1216,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'); @@ -1249,10 +1249,10 @@ Picking.prototype.drillPickFromRayMostDetailed = function ( objectsToExclude, width, false, - true, + true ); - }, - ), + } + ) ); }; @@ -1266,12 +1266,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; @@ -1287,7 +1287,7 @@ function getRayForClampToHeight(scene, cartesian) { const cartographic = Cartographic.fromCartesian( cartesian, ellipsoid, - scratchCartographic, + scratchCartographic ); return getRayForSampleHeight(scene, cartographic); } @@ -1297,7 +1297,7 @@ function getHeightFromCartesian(scene, cartesian) { const cartographic = Cartographic.fromCartesian( cartesian, ellipsoid, - scratchCartographic, + scratchCartographic ); return cartographic.height; } @@ -1307,7 +1307,7 @@ function sampleHeightMostDetailed( scene, cartographic, objectsToExclude, - width, + width ) { const ray = getRayForSampleHeight(scene, cartographic); return launchMostDetailedRayPick( @@ -1324,12 +1324,12 @@ function sampleHeightMostDetailed( objectsToExclude, width, true, - true, + true ); if (defined(pickResult)) { return getHeightFromCartesian(scene, pickResult.position); } - }, + } ); } @@ -1339,7 +1339,7 @@ function clampToHeightMostDetailed( cartesian, objectsToExclude, width, - result, + result ) { const ray = getRayForClampToHeight(scene, cartesian); return launchMostDetailedRayPick( @@ -1356,12 +1356,12 @@ function clampToHeightMostDetailed( objectsToExclude, width, true, - true, + true ); if (defined(pickResult)) { return Cartesian3.clone(pickResult.position, result); } - }, + } ); } @@ -1369,7 +1369,7 @@ Picking.prototype.sampleHeight = function ( scene, position, objectsToExclude, - width, + width ) { //>>includeStart('debug', pragmas.debug); Check.defined("position", position); @@ -1378,7 +1378,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'); @@ -1391,7 +1391,7 @@ Picking.prototype.sampleHeight = function ( objectsToExclude, width, true, - false, + false ); if (defined(pickResult)) { return getHeightFromCartesian(scene, pickResult.position); @@ -1403,7 +1403,7 @@ Picking.prototype.clampToHeight = function ( cartesian, objectsToExclude, width, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.defined("cartesian", cartesian); @@ -1412,7 +1412,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'); @@ -1425,7 +1425,7 @@ Picking.prototype.clampToHeight = function ( objectsToExclude, width, true, - false, + false ); if (defined(pickResult)) { return Cartesian3.clone(pickResult.position, result); @@ -1436,18 +1436,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'); @@ -1463,7 +1463,7 @@ Picking.prototype.sampleHeightMostDetailed = function ( scene, positions[i], objectsToExclude, - width, + width ); } return deferPromiseUntilPostRender( @@ -1474,7 +1474,7 @@ Picking.prototype.sampleHeightMostDetailed = function ( positions[i].height = heights[i]; } return positions; - }), + }) ); }; @@ -1482,18 +1482,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'); @@ -1510,7 +1510,7 @@ Picking.prototype.clampToHeightMostDetailed = function ( cartesians[i], objectsToExclude, width, - cartesians[i], + cartesians[i] ); } return deferPromiseUntilPostRender( @@ -1521,7 +1521,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 e58c52317b33..eb60db304b65 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 6f41c9fc7330..0dc44523cd53 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,12 +216,11 @@ 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)) { @@ -248,7 +247,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 @@ -272,7 +271,7 @@ function initialize(pointCloud, options) { pointCloud._batchTableLoaded( parsedContent.batchLength, parsedContent.batchTableJson, - parsedContent.batchTableBinary, + parsedContent.batchTableBinary ); } @@ -333,15 +332,14 @@ 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(); @@ -452,7 +450,7 @@ function createResources(pointCloud, frameState) { if (hasBatchIds) { batchIds.typedArray = prepareVertexAttribute( batchIds.typedArray, - "batchIds", + "batchIds" ); batchIdsVertexBuffer = Buffer.createVertexBuffer({ context: context, @@ -489,11 +487,12 @@ 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 + ); } } @@ -591,7 +590,7 @@ function createResources(pointCloud, frameState) { pointCloud._opaqueRenderState = RenderState.fromCache(opaqueRenderState); pointCloud._translucentRenderState = RenderState.fromCache( - translucentRenderState, + translucentRenderState ); pointCloud._drawCommand = new DrawCommand({ @@ -622,8 +621,7 @@ function createUniformMap(pointCloud, frameState) { let uniformMap = { u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier: function () { - const scratch = - scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier; + const scratch = scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier; scratch.x = pointCloud._attenuation ? pointCloud.maximumAttenuation : pointCloud._pointSize; @@ -681,22 +679,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 ); }, }; @@ -710,7 +708,7 @@ function createUniformMap(pointCloud, frameState) { if (defined(pointCloud._quantizedVolumeScale)) { const scale = Cartesian3.clone( pointCloud._quantizedVolumeScale, - scratch, + scratch ); Cartesian3.divideByScalar(scale, pointCloud._quantizedRange, scratch); } @@ -804,8 +802,9 @@ 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; } } @@ -824,17 +823,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; @@ -870,7 +869,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" ); } @@ -881,7 +880,7 @@ function createShaders(pointCloud, frameState, style) { const enabled = styleablePropertyIds.indexOf(attribute.location) >= 0; const vertexAttribute = getVertexAttribute( vertexArray, - attribute.location, + attribute.location ); vertexAttribute.enabled = enabled; } @@ -900,7 +899,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; } @@ -1111,7 +1110,7 @@ function createShaders(pointCloud, frameState, style) { if (hasClippedContent) { fs += - "uniform highp sampler2D u_clippingPlanes; \n" + + "uniform highp sampler2D u_clippingPlanes; \nff" + "uniform mat4 u_clippingPlanesMatrix; \n" + "uniform vec4 u_clippingPlanesEdgeStyle; \n"; fs += "\n"; @@ -1128,7 +1127,7 @@ function createShaders(pointCloud, frameState, style) { fs += getClipAndStyleCode( "u_clippingPlanes", "u_clippingPlanesMatrix", - "u_clippingPlanesEdgeStyle", + "u_clippingPlanesEdgeStyle" ); } @@ -1164,7 +1163,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." ); } } @@ -1208,10 +1207,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; @@ -1318,7 +1317,7 @@ PointCloud.prototype.update = function (frameState) { Matrix4.multiplyByTranslation( modelMatrix, this._quantizedVolumeOffset, - modelMatrix, + modelMatrix ); } @@ -1327,7 +1326,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 0b51dca79435..a4ef56deca6f 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 23a85575ee65..2a46b8fc75c0 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 db93554292cc..dfa57c8ed830 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,12 +132,9 @@ 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; @@ -146,7 +143,7 @@ function makeDirty(pointPrimitive, propertyChanged) { if (defined(pointPrimitiveCollection)) { pointPrimitiveCollection._updatePointPrimitive( pointPrimitive, - propertyChanged, + propertyChanged ); pointPrimitive._dirty = true; } @@ -234,7 +231,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'); @@ -277,7 +274,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'); @@ -286,7 +283,7 @@ Object.defineProperties(PointPrimitive.prototype, { if (!NearFarScalar.equals(translucencyByDistance, value)) { this._translucencyByDistance = NearFarScalar.clone( value, - translucencyByDistance, + translucencyByDistance ); makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX); } @@ -420,7 +417,7 @@ Object.defineProperties(PointPrimitive.prototype, { ) { this._distanceDisplayCondition = DistanceDisplayCondition.clone( value, - this._distanceDisplayCondition, + this._distanceDisplayCondition ); makeDirty(this, DISTANCE_DISPLAY_CONDITION_INDEX); } @@ -443,7 +440,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'); @@ -541,7 +538,7 @@ const tempCartesian3 = new Cartesian4(); PointPrimitive._computeActualPosition = function ( position, frameState, - modelMatrix, + modelMatrix ) { if (frameState.mode === SceneMode.SCENE3D) { return position; @@ -550,7 +547,7 @@ PointPrimitive._computeActualPosition = function ( Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3); return SceneTransforms.computeActualEllipsoidPosition( frameState, - tempCartesian3, + tempCartesian3 ); }; @@ -561,7 +558,7 @@ PointPrimitive._computeScreenSpacePosition = function ( modelMatrix, position, scene, - result, + result ) { // Model to world coordinates const positionWorld = Matrix4.multiplyByVector( @@ -571,14 +568,14 @@ PointPrimitive._computeScreenSpacePosition = function ( position.y, position.z, 1, - scratchCartesian4, + scratchCartesian4 ), - scratchCartesian4, + scratchCartesian4 ); const positionWC = SceneTransforms.worldToWindowCoordinates( scene, positionWorld, - result, + result ); return positionWC; }; @@ -617,7 +614,7 @@ PointPrimitive.prototype.computeScreenSpacePosition = function (scene, result) { modelMatrix, this._actualPosition, scene, - result, + result ); if (!defined(windowCoordinates)) { return undefined; @@ -639,7 +636,7 @@ PointPrimitive.prototype.computeScreenSpacePosition = function (scene, result) { PointPrimitive.getScreenSpaceBoundingBox = function ( point, screenSpacePosition, - result, + result ) { const size = point.pixelSize; const halfSize = size * 0.5; @@ -682,11 +679,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 c49029fcc16a..20ab1c5d6e1d 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,11 +380,12 @@ 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]; @@ -499,7 +500,7 @@ function createVAF(context, numberOfPointPrimitives, buffersUsage) { usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX], }, ], - numberOfPointPrimitives, + numberOfPointPrimitives ); // 1 vertex per pointPrimitive } @@ -514,7 +515,7 @@ function writePositionSizeAndOutline( pointPrimitiveCollection, context, vafWriters, - pointPrimitive, + pointPrimitive ) { const i = pointPrimitive._index; const position = pointPrimitive._getActualPosition(); @@ -523,7 +524,7 @@ function writePositionSizeAndOutline( BoundingSphere.expand( pointPrimitiveCollection._baseVolume, position, - pointPrimitiveCollection._baseVolume, + pointPrimitiveCollection._baseVolume ); pointPrimitiveCollection._boundingVolumeDirty = true; } @@ -534,7 +535,7 @@ function writePositionSizeAndOutline( pointPrimitiveCollection._maxPixelSize = Math.max( pointPrimitiveCollection._maxPixelSize, - pixelSize + outlineWidth, + pixelSize + outlineWidth ); const positionHighWriter = vafWriters[attributeLocations.positionHighAndSize]; @@ -554,7 +555,7 @@ function writeCompressedAttrib0( pointPrimitiveCollection, context, vafWriters, - pointPrimitive, + pointPrimitive ) { const i = pointPrimitive._index; @@ -590,7 +591,7 @@ function writeCompressedAttrib1( pointPrimitiveCollection, context, vafWriters, - pointPrimitive, + pointPrimitive ) { const i = pointPrimitive._index; @@ -640,7 +641,7 @@ function writeScaleByDistance( pointPrimitiveCollection, context, vafWriters, - pointPrimitive, + pointPrimitive ) { const i = pointPrimitive._index; const writer = vafWriters[attributeLocations.scaleByDistance]; @@ -670,7 +671,7 @@ function writeDistanceDisplayConditionAndDepthDisableAndSplitDirection( pointPrimitiveCollection, context, vafWriters, - pointPrimitive, + pointPrimitive ) { const i = pointPrimitive._index; const writer = @@ -713,37 +714,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 ); } @@ -753,7 +754,7 @@ function recomputeActualPositions( length, frameState, modelMatrix, - recomputeBoundingVolume, + recomputeBoundingVolume ) { let boundingVolume; if (frameState.mode === SceneMode.SCENE3D) { @@ -770,7 +771,7 @@ function recomputeActualPositions( const actualPosition = PointPrimitive._computeActualPosition( position, frameState, - modelMatrix, + modelMatrix ); if (defined(actualPosition)) { pointPrimitive._setActualPosition(actualPosition); @@ -817,7 +818,7 @@ function updateMode(pointPrimitiveCollection, frameState) { pointPrimitives.length, frameState, modelMatrix, - true, + true ); } } else if (mode === SceneMode.MORPHING) { @@ -827,7 +828,7 @@ function updateMode(pointPrimitiveCollection, frameState) { pointPrimitives.length, frameState, modelMatrix, - true, + true ); } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) { recomputeActualPositions( @@ -836,7 +837,7 @@ function updateMode(pointPrimitiveCollection, frameState) { pointPrimitiveCollection._pointPrimitivesToUpdateIndex, frameState, modelMatrix, - false, + false ); } } @@ -845,7 +846,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; @@ -938,7 +939,7 @@ PointPrimitiveCollection.prototype.update = function (frameState) { properties[SPLIT_DIRECTION_INDEX] ) { writers.push( - writeDistanceDisplayConditionAndDepthDisableAndSplitDirection, + writeDistanceDisplayConditionAndDepthDisableAndSplitDirection ); } @@ -992,7 +993,7 @@ PointPrimitiveCollection.prototype.update = function (frameState) { BoundingSphere.transform( this._baseVolume, this.modelMatrix, - this._baseVolumeWC, + this._baseVolumeWC ); } @@ -1002,12 +1003,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); @@ -1133,10 +1134,8 @@ 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 3a070db7fc0d..b8eda50752e0 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 5805ac5a9f02..81973318e16e 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,10 +1482,12 @@ 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; @@ -1508,7 +1510,7 @@ PolylineBucket.prototype.write = function ( : polyline._boundingVolumeWC; const encodedCenter = EncodedCartesian3.fromCartesian( boundingSphere.center, - scratchUpdatePolylineEncodedCartesian, + scratchUpdatePolylineEncodedCartesian ); const high = encodedCenter.high; const low = Cartesian4.fromElements( @@ -1516,7 +1518,7 @@ PolylineBucket.prototype.write = function ( encodedCenter.low.y, encodedCenter.low.z, boundingSphere.radius, - scratchUpdatePolylineCartesian4, + scratchUpdatePolylineCartesian4 ); const nearFarCartesian = scratchNearFarCartesian2; @@ -1547,7 +1549,7 @@ const morphVectorScratch = new Cartesian3(); PolylineBucket.prototype.writeForMorph = function ( positionArray, - positionIndex, + positionIndex ) { const modelMatrix = this.modelMatrix; const polylines = this.polylines; @@ -1578,13 +1580,13 @@ PolylineBucket.prototype.writeForMorph = function ( prevPosition = Matrix4.multiplyByPoint( modelMatrix, prevPosition, - morphPrevPositionScratch, + morphPrevPositionScratch ); const position = Matrix4.multiplyByPoint( modelMatrix, positions[j], - morphPositionScratch, + morphPositionScratch ); let nextPosition; @@ -1596,12 +1598,12 @@ PolylineBucket.prototype.writeForMorph = function ( Cartesian3.subtract( positions[positionsLength - 1], positions[positionsLength - 2], - nextPosition, + nextPosition ); Cartesian3.add( positions[positionsLength - 1], nextPosition, - nextPosition, + nextPosition ); } } else { @@ -1611,7 +1613,7 @@ PolylineBucket.prototype.writeForMorph = function ( nextPosition = Matrix4.multiplyByPoint( modelMatrix, nextPosition, - morphNextPositionScratch, + morphNextPositionScratch ); const segmentLength = lengths[segmentIndex]; @@ -1631,12 +1633,12 @@ PolylineBucket.prototype.writeForMorph = function ( EncodedCartesian3.writeElements( prevPosition, positionArray, - positionIndex + 6, + positionIndex + 6 ); EncodedCartesian3.writeElements( nextPosition, positionArray, - positionIndex + 12, + positionIndex + 12 ); positionIndex += 6 * 3; @@ -1651,7 +1653,7 @@ PolylineBucket.prototype.updateIndices = function ( totalIndices, vertexBufferOffset, vertexArrayBuckets, - offset, + offset ) { let vaCount = vertexArrayBuckets.length - 1; let bucketLocator = new VertexArrayBucketLocator(0, offset, this); @@ -1785,21 +1787,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 ); } @@ -1814,7 +1816,7 @@ PolylineBucket.prototype.writeUpdate = function ( index, polyline, positionBuffer, - projection, + projection ) { const mode = this.mode; const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI; @@ -1831,13 +1833,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 ); } @@ -1875,7 +1877,7 @@ PolylineBucket.prototype.writeUpdate = function ( Cartesian3.subtract( positions[positionsLength - 1], positions[positionsLength - 2], - position, + position ); Cartesian3.add(positions[positionsLength - 1], position, position); } @@ -1930,17 +1932,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; } @@ -1948,7 +1950,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 1bb49df68936..27c577fa1b7c 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 d47e73d2bb6c..0f048aa81ea2 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 44012ca77b56..1b93e702417a 100644 --- a/packages/engine/Source/Scene/PostProcessStage.js +++ b/packages/engine/Source/Scene/PostProcessStage.js @@ -105,7 +105,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."); @@ -118,12 +118,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); @@ -509,7 +509,7 @@ function createUniformMap(stage) { ) { uniformMap[`${name}Dimensions`] = getUniformMapDimensionsFunction( uniformMap, - name, + name ); } } @@ -673,12 +673,13 @@ function updateUniformTextures(stage, context) { for (let i = 0; i < dirtyUniforms.length; ++i) { const 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({ @@ -686,7 +687,7 @@ function updateUniformTextures(stage, context) { }); promises.push( - resource.fetchImage().then(createLoadImageFunction(stage, name)), + resource.fetchImage().then(createLoadImageFunction(stage, name)) ); } else { stage._texturesToCreate.push({ @@ -917,7 +918,7 @@ PostProcessStage.prototype.update = function (context, useLogDepth) { 0, 0, colorTexture.width, - colorTexture.height, + colorTexture.height ), }); } @@ -938,7 +939,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 59ca0e293923..af65a360285d 100644 --- a/packages/engine/Source/Scene/PostProcessStageCollection.js +++ b/packages/engine/Source/Scene/PostProcessStageCollection.js @@ -347,32 +347,29 @@ 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; } @@ -459,7 +456,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'); @@ -584,7 +581,7 @@ PostProcessStageCollection.prototype.getStageByName = function (name) { PostProcessStageCollection.prototype.update = function ( context, useLogDepth, - useHdr, + useHdr ) { removeStages(this); @@ -757,7 +754,7 @@ function execute(stage, context, colorTexture, depthTexture, idTexture) { context, getOutputTexture(stage.get(i - 1)), depthTexture, - idTexture, + idTexture ); } } else { @@ -781,7 +778,7 @@ PostProcessStageCollection.prototype.execute = function ( context, colorTexture, depthTexture, - idTexture, + idTexture ) { const activeStages = this._activeStages; const length = activeStages.length; @@ -835,7 +832,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 6745ac7546d5..bcea9587afa0 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 f4329daee77f..18aaa1d974b5 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 391b7dd3aff6..cdc6e21a3986 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 5b9f38b70526..f1128facaa7a 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,8 +670,7 @@ function createBatchTable(primitive, context) { primitive._batchTable = batchTable; primitive._batchTableAttributeIndices = attributeIndices; - primitive._batchTableBoundingSphereAttributeIndices = - boundingSphereAttributeIndices; + primitive._batchTableBoundingSphereAttributeIndices = boundingSphereAttributeIndices; primitive._batchTableOffsetAttribute2DIndex = offset2DIndex; } @@ -732,7 +731,7 @@ const positionRegex = /in\s+vec(?:3|4)\s+(.*)3DHigh;/g; Primitive._modifyShaderPosition = function ( primitive, vertexShaderSource, - scene3DOnly, + scene3DOnly ) { let match; @@ -744,7 +743,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. @@ -789,11 +788,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"; @@ -807,17 +806,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" ); }; @@ -828,7 +827,7 @@ Primitive._appendShowToShader = function (primitive, vertexShaderSource) { const renamedVS = ShaderSource.replaceMain( vertexShaderSource, - "czm_non_show_main", + "czm_non_show_main" ); const showMain = "void main() \n" + @@ -843,7 +842,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. @@ -864,7 +863,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'); @@ -874,12 +873,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; @@ -906,7 +905,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; }; @@ -920,7 +919,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"; @@ -936,7 +935,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; }; @@ -944,7 +943,7 @@ Primitive._appendOffsetToShader = function (primitive, vertexShaderSource) { Primitive._appendDistanceDisplayConditionToShader = function ( primitive, vertexShaderSource, - scene3DOnly, + scene3DOnly ) { if ( !defined(primitive._batchTableAttributeIndices.distanceDisplayCondition) @@ -954,7 +953,7 @@ Primitive._appendDistanceDisplayConditionToShader = function ( const renamedVS = ShaderSource.replaceMain( vertexShaderSource, - "czm_non_distanceDisplayCondition_main", + "czm_non_distanceDisplayCondition_main" ); let distanceDisplayConditionMain = "void main() \n" + @@ -1089,7 +1088,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" + @@ -1102,7 +1101,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" + @@ -1133,7 +1132,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.` ); } } @@ -1149,7 +1148,7 @@ function getUniformFunction(uniforms, name) { const numberOfCreationWorkers = Math.max( FeatureDetection.hardwareConcurrency - 1, - 1, + 1 ); let createGeometryTaskProcessors; const combineGeometryTaskProcessor = new TaskProcessor("combineGeometry"); @@ -1180,7 +1179,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'); @@ -1213,7 +1212,7 @@ function loadAsynchronous(primitive, frameState) { subTask.offset = packedLength; packedLength += defaultValue( geometry.constructor.packedLength, - geometry.packedLength, + geometry.packedLength ); } } @@ -1239,8 +1238,8 @@ function loadAsynchronous(primitive, frameState) { { subTasks: subTasks[i], }, - subTaskTransferableObjects, - ), + subTaskTransferableObjects + ) ); } @@ -1277,9 +1276,9 @@ function loadAsynchronous(primitive, frameState) { modelMatrix: primitive.modelMatrix, createPickOffsets: primitive._createPickOffsets, }, - transferableObjects, + transferableObjects ), - transferableObjects, + transferableObjects ); primitive._createGeometryResults = undefined; @@ -1287,13 +1286,14 @@ 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 4dc20383fc36..c28e0ed24c2b 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 40e7c0e7a4df..cfa038c71f30 100644 --- a/packages/engine/Source/Scene/PrimitiveLoadPlan.js +++ b/packages/engine/Source/Scene/PrimitiveLoadPlan.js @@ -7,6 +7,11 @@ import BufferUsage from "../Renderer/BufferUsage.js"; import AttributeType from "./AttributeType.js"; import ModelComponents from "./ModelComponents.js"; import PrimitiveOutlineGenerator from "./Model/PrimitiveOutlineGenerator.js"; +import GaussianSplatTextureGenerator from "./Model/GaussianSplatTextureGenerator.js"; +import Texture from "../Renderer/Texture.js"; +import PixelFormat from "../Core/PixelFormat.js"; +import PixelDatatype from "../Renderer/PixelDatatype.js"; +import Sampler from "../Renderer/Sampler.js"; /** * Simple struct for tracking whether an attribute will be loaded as a buffer @@ -157,6 +162,23 @@ function PrimitiveLoadPlan(primitive) { * @private */ this.outlineIndices = undefined; + + /** + * Set this true to indicate that the primitive has the + * KHR_gaussian_splatting extension and needs to be post-processed + * + * @type {boolean} + * @private + */ + this.needsGaussianSplats = false; + + /** + * Set this to true if generating textures for Gaussian Splat rendering + * + * @type {boolean} + * @private + */ + this.generateGaussianSplatTexture = true; } /** @@ -174,6 +196,16 @@ PrimitiveLoadPlan.prototype.postProcess = function (context) { generateOutlines(this); generateBuffers(this, context); } + + //handle splat post-processing for point primitives + if (this.needsGaussianSplats) { + this.primitive.isGaussianSplatPrimitive = true; + if (this.generateGaussianSplatTexture) { + generateSplatTexture(this, context); + } else { + setupGaussianSplatBuffers(this, context); + } + } }; function generateOutlines(loadPlan) { @@ -226,6 +258,56 @@ function makeOutlineCoordinatesAttribute(outlineCoordinatesTypedArray) { return attribute; } +function setupGaussianSplatBuffers(loadPlan, context) { + const attributePlans = loadPlan.attributePlans; + const attrLen = attributePlans.length; + for (let i = 0; i < attrLen; i++) { + const attributePlan = attributePlans[i]; + //defer til much later into the pipeline + attributePlan.loadBuffer = false; + attributePlan.loadTypedArray = true; + } +} + +function generateSplatTexture(loadPlan, context) { + loadPlan.primitive.gaussianSplatTexturePending = true; + + GaussianSplatTextureGenerator.generateFromAttrs( + loadPlan.primitive.attributes, + loadPlan.primitive.attributes[0].count, + ).then((splatTextureData) => { + const splatTex = new Texture({ + context, + source: { + width: splatTextureData.width, + height: splatTextureData.height, + arrayBufferView: splatTextureData.data, + }, + preMultiplyAlpha: false, + skipColorSpaceConversion: true, + pixelFormat: PixelFormat.RGBA_INTEGER, + pixelDatatype: PixelDatatype.UNSIGNED_INT, + flipY: false, + sampler: Sampler.NEAREST, + }); + const count = loadPlan.primitive.attributes[0].count; + const attribute = new ModelComponents.Attribute(); + + attribute.name = "_SPLAT_INDEXES"; + attribute.typedArray = new Uint32Array([...Array(count).keys()]); + attribute.componentDatatype = ComponentDatatype.UNSIGNED_INT; + attribute.type = AttributeType.SCALAR; + attribute.normalized = false; + attribute.count = count; + attribute.constant = 0; + attribute.instanceDivisor = 1; + + loadPlan.primitive.attributes.push(attribute); + loadPlan.primitive.gaussianSplatTexture = splatTex; + loadPlan.primitive.hasGaussianSplatTexture = true; + }); +} + function generateBuffers(loadPlan, context) { generateAttributeBuffers(loadPlan.attributePlans, context); diff --git a/packages/engine/Source/Scene/PrimitivePipeline.js b/packages/engine/Source/Scene/PrimitivePipeline.js index f90dd5058a95..fa1312ee8406 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 cbb73b3cfd9b..19860c82de18 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/PropertyTextureProperty.js b/packages/engine/Source/Scene/PropertyTextureProperty.js index 765c2507313e..aed6e39e4bab 100644 --- a/packages/engine/Source/Scene/PropertyTextureProperty.js +++ b/packages/engine/Source/Scene/PropertyTextureProperty.js @@ -188,25 +188,25 @@ PropertyTextureProperty.prototype.isGpuCompatible = function () { // only support arrays of 1-4 UINT8 scalars (normalized or unnormalized) if (classProperty.isVariableLengthArray) { oneTimeWarning( - `Property texture property ${classProperty.id} is a variable-length array, which is not supported`, + `Property texture property ${classProperty.id} is a variable-length array, which is not supported` ); return false; } if (classProperty.arrayLength > 4) { oneTimeWarning( - `Property texture property ${classProperty.id} is an array of length ${classProperty.arrayLength}, but may have at most a length of 4`, + `Property texture property ${classProperty.id} is an array of length ${classProperty.arrayLength}, but may have at most a length of 4` ); return false; } if (type !== MetadataType.SCALAR) { oneTimeWarning( - `Property texture property ${classProperty.id} is an array of type ${type}, but only SCALAR is supported`, + `Property texture property ${classProperty.id} is an array of type ${type}, but only SCALAR is supported` ); return false; } if (componentType !== MetadataComponentType.UINT8) { oneTimeWarning( - `Property texture property ${classProperty.id} is an array with component type ${componentType}, but only UINT8 is supported`, + `Property texture property ${classProperty.id} is an array with component type ${componentType}, but only UINT8 is supported` ); return false; } @@ -216,7 +216,7 @@ PropertyTextureProperty.prototype.isGpuCompatible = function () { if (MetadataType.isVectorType(type) || type === MetadataType.SCALAR) { if (componentType !== MetadataComponentType.UINT8) { oneTimeWarning( - `Property texture property ${classProperty.id} has component type ${componentType}, but only UINT8 is supported`, + `Property texture property ${classProperty.id} has component type ${componentType}, but only UINT8 is supported` ); return false; } @@ -226,7 +226,7 @@ PropertyTextureProperty.prototype.isGpuCompatible = function () { // For this initial implementation, only UINT8-based properties // are supported. oneTimeWarning( - `Property texture property ${classProperty.id} has an unsupported type`, + `Property texture property ${classProperty.id} has an unsupported type` ); return false; }; diff --git a/packages/engine/Source/Scene/QuadtreePrimitive.js b/packages/engine/Source/Scene/QuadtreePrimitive.js index 545b7ecde978..66ed2109ca30 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,8 +523,9 @@ 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); @@ -572,13 +573,12 @@ function selectTilesForRendering(primitive, frameState) { primitive._cameraPositionCartographic = camera.positionCartographic; const cameraFrameOrigin = Matrix4.getTranslation( camera.transform, - cameraOriginScratch, + cameraOriginScratch + ); + primitive._cameraReferenceFrameOriginCartographic = primitive.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic( + cameraFrameOrigin, + primitive._cameraReferenceFrameOriginCartographic ); - 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,8 +1251,9 @@ 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; @@ -1282,8 +1283,9 @@ 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); @@ -1330,7 +1332,7 @@ function processTileLoadQueue(primitive, frameState) { tileProvider, endTime, tileLoadQueueHigh, - false, + false ); didSomeLoading = processSinglePriorityLoadQueue( primitive, @@ -1338,7 +1340,7 @@ function processTileLoadQueue(primitive, frameState) { tileProvider, endTime, tileLoadQueueMedium, - didSomeLoading, + didSomeLoading ); processSinglePriorityLoadQueue( primitive, @@ -1346,7 +1348,7 @@ function processTileLoadQueue(primitive, frameState) { tileProvider, endTime, tileLoadQueueLow, - didSomeLoading, + didSomeLoading ); } @@ -1360,7 +1362,7 @@ function processSinglePriorityLoadQueue( tileProvider, endTime, loadQueue, - didSomeLoading, + didSomeLoading ) { if (tileProvider.computeTileLoadPriority !== undefined) { loadQueue.sort(sortByLoadPriority); @@ -1441,14 +1443,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 @@ -1458,7 +1460,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 @@ -1475,12 +1477,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 { @@ -1493,7 +1495,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); @@ -1504,7 +1506,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 c0ccdde4dc97..601458acbbf7 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 9f1bfee43906..75cce94869f8 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 8d6c2a6afab6..e29571cfb994 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 085a2d3d0b70..6763461cebcb 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 e751dda94087..cfaf2da03a19 100644 --- a/packages/engine/Source/Scene/Scene.js +++ b/packages/engine/Source/Scene/Scene.js @@ -2364,7 +2364,6 @@ function executeTranslucentCommandsFrontToBack( executeFunction(commands[i], scene, passState); } } - /** * Execute commands to render voxels in the scene. * @@ -2387,6 +2386,20 @@ function performVoxelsPass(scene, passState, frustumCommands) { } } +function performGaussianSplatPass(scene, passState, frustumCommands) { + scene.context.uniformState.updatePass(Pass.GAUSSIAN_SPLATS); + + const commands = frustumCommands.commands[Pass.GAUSSIAN_SPLATS]; + commands.length = frustumCommands.indices[Pass.GAUSSIAN_SPLATS]; + + //still necessary? + mergeSort(commands, backToFront, scene.camera.positionWC); + + for (let i = 0; i < commands.length; ++i) { + executeCommand(commands[i], scene, passState); + } +} + const scratchPerspectiveFrustum = new PerspectiveFrustum(); const scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum(); const scratchOrthographicFrustum = new OrthographicFrustum(); @@ -2784,6 +2797,8 @@ function executeCommands(scene, passState) { performPass(frustumCommands, Pass.OPAQUE); + performGaussianSplatPass(scene, passState, frustumCommands); + if (index !== 0 && scene.mode !== SceneMode.SCENE2D) { // Do not overlap frustums in the translucent pass to avoid blending artifacts frustum.near = frustumCommands.near; diff --git a/packages/engine/Source/Scene/SceneFramebuffer.js b/packages/engine/Source/Scene/SceneFramebuffer.js index 72e2611d58d4..274c623a5e8a 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 d982dbd8308e..84ae7a032b52 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 56e177cc08b1..4e632f36e53d 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 54e7aee3e113..44493e3def42 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,25 +632,23 @@ 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 ); } @@ -658,7 +656,7 @@ function handleZoom( object._useZoomWorldPosition = true; object._zoomWorldPosition = Cartesian3.clone( pickedPosition, - object._zoomWorldPosition, + object._zoomWorldPosition ); } else { object._useZoomWorldPosition = false; @@ -694,7 +692,7 @@ function handleZoom( const direction = Cartesian3.subtract( worldPosition, endPosition, - scratchZoomDirection, + scratchZoomDirection ); Cartesian3.normalize(direction, direction); @@ -707,25 +705,23 @@ 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 || @@ -744,7 +740,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 @@ -776,7 +772,7 @@ function handleZoom( Cartesian3.add( cameraPosition, Cartesian3.multiplyByScalar(forward, 1000, scratchCartesian), - center, + center ); const positionToTarget = scratchPositionToTarget; @@ -787,7 +783,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. @@ -799,22 +795,23 @@ 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; @@ -826,20 +823,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 @@ -849,24 +846,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; @@ -875,17 +872,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); @@ -897,7 +894,7 @@ function handleZoom( // Set new direction Cartesian3.normalize( Cartesian3.subtract(center, cameraPosition, scratchCartesian), - camera.direction, + camera.direction ); Cartesian3.clone(camera.direction, camera.direction); @@ -911,11 +908,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); @@ -924,7 +921,7 @@ function handleZoom( const axis = Cartesian3.cross( pickedNormal, positionNormal, - scratchZoomAxis, + scratchZoomAxis ); const denom = @@ -946,7 +943,7 @@ function handleZoom( const zoomMouseStart = SceneTransforms.worldToWindowCoordinates( scene, object._zoomWorldPosition, - scratchZoomOffset, + scratchZoomOffset ); if ( mode !== SceneMode.COLUMBUS_VIEW && @@ -964,7 +961,7 @@ function handleZoom( rayDirection.y, rayDirection.z, rayDirection.x, - rayDirection, + rayDirection ); } @@ -987,10 +984,8 @@ 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); @@ -1018,7 +1013,7 @@ function zoom2D(controller, startPosition, movement) { startPosition, movement, controller.zoomFactor, - camera.getMagnitude(), + camera.getMagnitude() ); } @@ -1094,7 +1089,7 @@ function update2D(controller) { controller.zoomEventTypes, zoom2D, controller.inertiaZoom, - "_lastInertiaZoomMovement", + "_lastInertiaZoomMovement" ); if (rotatable2D) { reactToInput( @@ -1103,7 +1098,7 @@ function update2D(controller) { controller.translateEventTypes, twist2D, controller.inertiaSpin, - "_lastInertiaSpinMovement", + "_lastInertiaSpinMovement" ); } } else { @@ -1113,7 +1108,7 @@ function update2D(controller) { controller.translateEventTypes, translate2D, controller.inertiaTranslate, - "_lastInertiaTranslateMovement", + "_lastInertiaTranslateMovement" ); reactToInput( controller, @@ -1121,7 +1116,7 @@ function update2D(controller) { controller.zoomEventTypes, zoom2D, controller.inertiaZoom, - "_lastInertiaZoomMovement", + "_lastInertiaZoomMovement" ); if (rotatable2D) { reactToInput( @@ -1130,7 +1125,7 @@ function update2D(controller) { controller.tiltEventTypes, twist2D, controller.inertiaSpin, - "_lastInertiaTiltMovement", + "_lastInertiaTiltMovement" ); } } @@ -1149,7 +1144,7 @@ function pickPosition(controller, mousePosition, result) { if (scene.pickPositionSupported) { depthIntersection = scene.pickPositionWorldCoordinates( mousePosition, - scratchDepthIntersection, + scratchDepthIntersection ); } @@ -1163,7 +1158,7 @@ function pickPosition(controller, mousePosition, result) { ray, scene, cullBackFaces, - scratchRayIntersection, + scratchRayIntersection ); const pickDistance = defined(depthIntersection) @@ -1192,7 +1187,7 @@ function getDistanceFromSurface(controller) { if (mode === SceneMode.SCENE3D) { const cartographic = ellipsoid.cartesianToCartographic( camera.position, - scratchDistanceCartographic, + scratchDistanceCartographic ); if (defined(cartographic)) { height = cartographic.height; @@ -1227,7 +1222,7 @@ function getTiltCenterUnderground(controller, ray, pickedPosition, result) { const maximumDistance = CesiumMath.clamp( distanceFromSurface * 5.0, controller._minimumUndergroundPickDistance, - controller._maximumUndergroundPickDistance, + controller._maximumUndergroundPickDistance ); if (distance > maximumDistance) { @@ -1243,7 +1238,7 @@ function getStrafeStartPositionUnderground( controller, ray, pickedPosition, - result, + result ) { let distance; if (!defined(pickedPosition)) { @@ -1268,7 +1263,7 @@ function continueStrafing(controller, movement) { const inertialDelta = Cartesian2.subtract( movement.endPosition, movement.startPosition, - scratchInertialDelta, + scratchInertialDelta ); const endPosition = controller._strafeEndMousePosition; Cartesian2.add(endPosition, inertialDelta, endPosition); @@ -1311,7 +1306,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); @@ -1338,7 +1333,7 @@ function translateCV(controller, startPosition, movement) { controller, startRay, globePos, - translateCVStartPos, + translateCVStartPos ); } Cartesian2.clone(startPosition, controller._strafeMousePosition); @@ -1355,14 +1350,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)) { @@ -1375,7 +1370,7 @@ function translateCV(controller, startPosition, movement) { const diff = Cartesian3.subtract( startPlanePos, endPlanePos, - translateCVDifference, + translateCVDifference ); const temp = diff.x; diff.x = diff.y; @@ -1472,7 +1467,7 @@ function rotateCVOnPlane(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - rotateCVTransform, + rotateCVTransform ); const oldGlobe = controller._globe; @@ -1559,7 +1554,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const verticalCenter = IntersectionTests.rayPlane( ray, plane, - rotateCVVerticalCenter, + rotateCVVerticalCenter ); const projection = camera._projection; @@ -1572,7 +1567,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - rotateCVTransform, + rotateCVTransform ); let verticalTransform; @@ -1581,7 +1576,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { verticalCenter.y, verticalCenter.z, verticalCenter.x, - verticalCenter, + verticalCenter ); cart = projection.unproject(verticalCenter, rotateCVCart); ellipsoid.cartographicToCartesian(cart, verticalCenter); @@ -1589,7 +1584,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { verticalTransform = Transforms.eastNorthUpToFixedFrame( verticalCenter, ellipsoid, - rotateCVVerticalTransform, + rotateCVVerticalTransform ); } else { verticalTransform = transform; @@ -1610,7 +1605,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); @@ -1641,7 +1636,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const right = Cartesian3.cross( camera.direction, camera.constrainedAxis, - tilt3DCartesian3, + tilt3DCartesian3 ); if ( !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6) @@ -1668,7 +1663,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { const originalPosition = Cartesian3.clone( camera.positionWC, - rotateCVCartesian3, + rotateCVCartesian3 ); if (controller.enableCollisionDetection) { @@ -1685,7 +1680,7 @@ function rotateCVOnTerrain(controller, startPosition, movement) { Cartesian3.multiplyByScalar( camera.position, Math.sqrt(magSqrd), - camera.position, + camera.position ); } @@ -1693,14 +1688,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); @@ -1756,7 +1751,7 @@ function zoomCV(controller, startPosition, movement) { const distanceUnderground = getZoomDistanceUnderground( controller, ray, - height, + height ); if (defined(distance)) { distance = Math.min(distance, distanceUnderground); @@ -1776,7 +1771,7 @@ function zoomCV(controller, startPosition, movement) { startPosition, movement, controller.zoomFactor, - distance, + distance ); } @@ -1791,7 +1786,7 @@ function updateCV(controller) { controller.rotateEventTypes, rotate3D, controller.inertiaSpin, - "_lastInertiaSpinMovement", + "_lastInertiaSpinMovement" ); reactToInput( controller, @@ -1799,7 +1794,7 @@ function updateCV(controller) { controller.zoomEventTypes, zoom3D, controller.inertiaZoom, - "_lastInertiaZoomMovement", + "_lastInertiaZoomMovement" ); } else { const tweens = controller._tweens; @@ -1814,7 +1809,7 @@ function updateCV(controller) { controller.tiltEventTypes, rotateCV, controller.inertiaSpin, - "_lastInertiaTiltMovement", + "_lastInertiaTiltMovement" ); reactToInput( controller, @@ -1822,7 +1817,7 @@ function updateCV(controller) { controller.translateEventTypes, translateCV, controller.inertiaTranslate, - "_lastInertiaTranslateMovement", + "_lastInertiaTranslateMovement" ); reactToInput( controller, @@ -1830,13 +1825,13 @@ function updateCV(controller) { controller.zoomEventTypes, zoomCV, controller.inertiaZoom, - "_lastInertiaZoomMovement", + "_lastInertiaZoomMovement" ); reactToInput( controller, controller.enableLook, controller.lookEventTypes, - look3D, + look3D ); if ( @@ -1844,7 +1839,7 @@ function updateCV(controller) { !tweens.contains(controller._tween) ) { const tween = camera.createCorrectPositionTween( - controller.bounceAnimationTime, + controller.bounceAnimationTime ); if (defined(tween)) { controller._tween = tweens.add(tween); @@ -1874,12 +1869,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; @@ -1946,7 +1941,7 @@ function spin3D(controller, startPosition, movement) { const height = ellipsoid.cartesianToCartographic( camera.positionWC, - scratchCartographic, + scratchCartographic ).height; const globe = controller._globe; @@ -1954,13 +1949,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) { @@ -2003,8 +1998,8 @@ function spin3D(controller, startPosition, movement) { camera.pickEllipsoid( movement.startPosition, controller._ellipsoid, - spin3DPick, - ), + spin3DPick + ) ) ) { pan3D(controller, startPosition, movement, controller._ellipsoid); @@ -2026,7 +2021,7 @@ function rotate3D( movement, constrainedAxis, rotateOnlyVertical, - rotateOnlyHorizontal, + rotateOnlyHorizontal ) { rotateOnlyVertical = defaultValue(rotateOnlyVertical, false); rotateOnlyHorizontal = defaultValue(rotateOnlyHorizontal, false); @@ -2059,7 +2054,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; @@ -2094,15 +2089,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; @@ -2118,7 +2113,7 @@ function pan3D(controller, startPosition, movement, ellipsoid) { !defined(controller._globe) && !Cartesian2.equalsEpsilon( startMousePosition, - controller._panLastMousePosition, + controller._panLastMousePosition ) ) { p0 = pickPosition(controller, startMousePosition, pan3DP0); @@ -2129,7 +2124,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( @@ -2137,35 +2132,33 @@ 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; @@ -2173,7 +2166,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)) * @@ -2181,7 +2174,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 @@ -2189,7 +2182,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); @@ -2274,11 +2267,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; @@ -2332,7 +2325,7 @@ function zoom3D(controller, startPosition, movement) { let intersection; const height = ellipsoid.cartesianToCartographic( camera.position, - zoom3DCartographic, + zoom3DCartographic ).height; const approachingCollision = @@ -2356,7 +2349,7 @@ function zoom3D(controller, startPosition, movement) { const distanceUnderground = getZoomDistanceUnderground( controller, ray, - height, + height ); if (defined(distance)) { distance = Math.min(distance, distanceUnderground); @@ -2371,7 +2364,7 @@ function zoom3D(controller, startPosition, movement) { const unitPosition = Cartesian3.normalize( camera.position, - zoom3DUnitPosition, + zoom3DUnitPosition ); handleZoom( controller, @@ -2379,7 +2372,7 @@ function zoom3D(controller, startPosition, movement) { movement, controller.zoomFactor, distance, - Cartesian3.dot(unitPosition, camera.direction), + Cartesian3.dot(unitPosition, camera.direction) ); } @@ -2415,7 +2408,7 @@ function tilt3D(controller, startPosition, movement) { if (controller._looking) { const up = controller._ellipsoid.geodeticSurfaceNormal( camera.position, - tilt3DLookUp, + tilt3DLookUp ); look3D(controller, startPosition, movement, up); return; @@ -2424,7 +2417,7 @@ function tilt3D(controller, startPosition, movement) { const ellipsoid = controller._ellipsoid; const cartographic = ellipsoid.cartesianToCartographic( camera.position, - tilt3DCart, + tilt3DCart ); if ( @@ -2447,7 +2440,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 && @@ -2470,25 +2463,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); @@ -2498,7 +2491,7 @@ function tilt3DOnEllipsoid(controller, startPosition, movement) { const transform = Transforms.eastNorthUpToFixedFrame( center, ellipsoid, - tilt3DTransform, + tilt3DTransform ); const oldGlobe = controller._globe; @@ -2543,13 +2536,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); @@ -2595,12 +2588,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; @@ -2618,7 +2611,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const tangent = Cartesian3.cross( verticalCenter, camera.positionWC, - tilt3DCartesian3, + tilt3DCartesian3 ); const dot = Cartesian3.dot(camera.rightWC, tangent); @@ -2649,7 +2642,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const right = Cartesian3.cross( camera.direction, camera.constrainedAxis, - tilt3DCartesian3, + tilt3DCartesian3 ); if ( !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6) @@ -2676,7 +2669,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const originalPosition = Cartesian3.clone( camera.positionWC, - tilt3DCartesian3, + tilt3DCartesian3 ); if (controller.enableCollisionDetection) { @@ -2693,7 +2686,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { Cartesian3.multiplyByScalar( camera.position, Math.sqrt(magSqrd), - camera.position, + camera.position ); } @@ -2701,7 +2694,7 @@ function tilt3DOnTerrain(controller, startPosition, movement) { const axis = Cartesian3.cross( originalPosition, camera.position, - originalPosition, + originalPosition ); Cartesian3.normalize(axis, axis); @@ -2812,17 +2805,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); @@ -2854,7 +2847,7 @@ function update3D(controller) { controller.rotateEventTypes, spin3D, controller.inertiaSpin, - "_lastInertiaSpinMovement", + "_lastInertiaSpinMovement" ); reactToInput( controller, @@ -2862,7 +2855,7 @@ function update3D(controller) { controller.zoomEventTypes, zoom3D, controller.inertiaZoom, - "_lastInertiaZoomMovement", + "_lastInertiaZoomMovement" ); reactToInput( controller, @@ -2870,13 +2863,13 @@ function update3D(controller) { controller.tiltEventTypes, tilt3D, controller.inertiaSpin, - "_lastInertiaTiltMovement", + "_lastInertiaTiltMovement" ); reactToInput( controller, controller.enableLook, controller.lookEventTypes, - look3D, + look3D ); } @@ -2951,7 +2944,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); @@ -3000,17 +2993,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); @@ -3022,11 +3015,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 1a6bd126eece..98a3389b9e0c 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 448d9816bf1e..3d8aaf1bd858 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,11 +1385,10 @@ 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]; @@ -1399,7 +1398,7 @@ function computeOmnidirectional(shadowMap, frameState) { camera.directionWC, camera.upWC, camera.rightWC, - camera.viewMatrix, + camera.viewMatrix ); Matrix4.inverse(camera.viewMatrix, camera.inverseViewMatrix); @@ -1428,14 +1427,13 @@ 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) { @@ -1445,7 +1443,7 @@ function checkVisibility(shadowMap, frameState) { shadowMap._darkness = CesiumMath.lerp( 1.0, shadowMap.darkness, - darknessAmount, + darknessAmount ); } else { shadowMap._darkness = shadowMap.darkness; @@ -1479,9 +1477,9 @@ function checkVisibility(shadowMap, frameState) { Cartesian3.multiplyByScalar( shadowMapCamera.directionWC, frustumRadius, - scratchCenter, + scratchCenter ), - scratchCenter, + scratchCenter ); boundingSphere.center = frustumCenter; boundingSphere.radius = frustumRadius; @@ -1515,7 +1513,7 @@ function updateCameras(shadowMap, frameState) { Matrix4.multiplyByPointAsVector( camera.viewMatrix, shadowMapCamera.directionWC, - lightDirection, + lightDirection ); Cartesian3.normalize(lightDirection, lightDirection); Cartesian3.negate(lightDirection, lightDirection); @@ -1524,7 +1522,7 @@ function updateCameras(shadowMap, frameState) { Matrix4.multiplyByPoint( camera.viewMatrix, shadowMapCamera.positionWC, - shadowMap._lightPositionEC, + shadowMap._lightPositionEC ); shadowMap._lightPositionEC.w = shadowMap._pointLightRadius; @@ -1536,7 +1534,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); @@ -1586,8 +1584,11 @@ 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. @@ -1595,7 +1596,7 @@ ShadowMap.prototype.update = function (frameState) { } } else { this._shadowMapCullingVolume = CullingVolume.fromBoundingSphere( - this._boundingSphere, + this._boundingSphere ); } } @@ -1607,7 +1608,7 @@ ShadowMap.prototype.update = function (frameState) { Matrix4.multiply( this._shadowMapCamera.getViewProjection(), inverseView, - this._shadowMapMatrix, + this._shadowMapMatrix ); } @@ -1629,8 +1630,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 () { @@ -1667,7 +1668,7 @@ function combineUniforms(shadowMap, uniforms, isTerrain) { texelStepSize.y, bias.depthBias, bias.normalShadingSmooth, - this.combinedUniforms1, + this.combinedUniforms1 ); }, shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness: function () { @@ -1676,7 +1677,7 @@ function combineUniforms(shadowMap, uniforms, isTerrain) { shadowMap._distance, shadowMap.maximumDistance, shadowMap._darkness, - this.combinedUniforms2, + this.combinedUniforms2 ); }, @@ -1693,7 +1694,7 @@ function createCastDerivedCommand( command, context, oldShaderId, - result, + result ) { let castShader; let castRenderState; @@ -1724,11 +1725,11 @@ function createCastDerivedCommand( isPointLight, isTerrain, usesDepthTexture, - isOpaque, + isOpaque ); castShader = context.shaderCache.getDerivedShaderProgram( shaderProgram, - keyword, + keyword ); if (!defined(castShader)) { const vertexShaderSource = shaderProgram.vertexShaderSource; @@ -1737,13 +1738,13 @@ function createCastDerivedCommand( const castVS = ShadowMapShader.createShadowCastVertexShader( vertexShaderSource, isPointLight, - isTerrain, + isTerrain ); const castFS = ShadowMapShader.createShadowCastFragmentShader( fragmentShaderSource, isPointLight, usesDepthTexture, - isOpaque, + isOpaque ); castShader = context.shaderCache.createDerivedShaderProgram( @@ -1753,7 +1754,7 @@ function createCastDerivedCommand( vertexShaderSource: castVS, fragmentShaderSource: castFS, attributeLocations: shaderProgram._attributeLocations, - }, + } ); } @@ -1788,7 +1789,7 @@ ShadowMap.createReceiveDerivedCommand = function ( command, shadowsDirty, context, - result, + result ) { if (!defined(result)) { result = {}; @@ -1817,7 +1818,7 @@ ShadowMap.createReceiveDerivedCommand = function ( result.receiveCommand = DrawCommand.shallowClone( command, - result.receiveCommand, + result.receiveCommand ); result.castShadows = false; result.receiveShadows = true; @@ -1839,24 +1840,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( @@ -1866,14 +1867,14 @@ ShadowMap.createReceiveDerivedCommand = function ( vertexShaderSource: receiveVS, fragmentShaderSource: receiveFS, attributeLocations: shaderProgram._attributeLocations, - }, + } ); } receiveUniformMap = combineUniforms( lightShadowMaps[0], command.uniformMap, - isTerrain, + isTerrain ); } @@ -1891,7 +1892,7 @@ ShadowMap.createCastDerivedCommand = function ( command, shadowsDirty, context, - result, + result ) { if (!defined(result)) { result = {}; @@ -1915,7 +1916,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 e7e56905787f..fc78fcfdd937 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 0e16baa57971..1e6f0603486f 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 6e51fb8d22dc..0487027ae47f 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 62bffed2f0ef..628737ce5610 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 aa175b9d405b..66c374c76099 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,10 +167,11 @@ 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 1617bb41ab23..2cd71600211c 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 bb58256c0168..4925d0847225 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 f97c513041ad..5d9fae62e338 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 d8ad4339084d..10e49410f645 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 5a3d9d069b51..45eeb785a7c1 100644 --- a/packages/engine/Source/Scene/Sun.js +++ b/packages/engine/Source/Scene/Sun.js @@ -270,15 +270,11 @@ 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; @@ -291,28 +287,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 ab025a5d4889..81277c2ef6ca 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 a23c50ce30c5..9d1671493a63 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,20 +997,19 @@ 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, @@ -1022,7 +1021,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. @@ -1072,7 +1071,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { nwCorner.height, nwCorner.encodedNormal, 1.0, - heightRange, + heightRange ); nextIndex = addEdge( fill, @@ -1083,7 +1082,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.westTiles, fill.westMeshes, TileEdge.EAST, - heightRange, + heightRange ); const southwestIndex = nextIndex; nextIndex = addVertexWithComputedPosition( @@ -1097,7 +1096,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { swCorner.height, swCorner.encodedNormal, 0.0, - heightRange, + heightRange ); nextIndex = addEdge( fill, @@ -1108,7 +1107,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.southTiles, fill.southMeshes, TileEdge.NORTH, - heightRange, + heightRange ); const southeastIndex = nextIndex; nextIndex = addVertexWithComputedPosition( @@ -1122,7 +1121,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { seCorner.height, seCorner.encodedNormal, 0.0, - heightRange, + heightRange ); nextIndex = addEdge( fill, @@ -1133,7 +1132,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.eastTiles, fill.eastMeshes, TileEdge.WEST, - heightRange, + heightRange ); const northeastIndex = nextIndex; nextIndex = addVertexWithComputedPosition( @@ -1147,7 +1146,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { neCorner.height, neCorner.encodedNormal, 1.0, - heightRange, + heightRange ); nextIndex = addEdge( fill, @@ -1158,7 +1157,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) { fill.northTiles, fill.northMeshes, TileEdge.SOUTH, - heightRange, + heightRange ); minimumHeight = heightRange.minimumHeight; @@ -1168,30 +1167,31 @@ 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,32 +2100,31 @@ 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; - } - return targetUv.y - v; - } else if (compareU) { - return u - targetUv.x; + 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 v - targetUv.y; - }, - ); + return targetUv.y - v; + } else if (compareU) { + return u - targetUv.x; + } + return v - targetUv.y; + }); if (vertexIndexIndex < 0) { vertexIndexIndex = ~vertexIndexIndex; @@ -2142,7 +2141,7 @@ function getCornerFromEdge( u, v, compareU, - vertex, + vertex ); return true; } @@ -2153,7 +2152,7 @@ function getCornerFromEdge( edgeVertices[vertexIndexIndex], u, v, - vertex, + vertex ); return true; } @@ -2176,7 +2175,7 @@ function computeOccludeePoint( rectangle, minimumHeight, maximumHeight, - result, + result ) { const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid; const ellipsoid = ellipsoidalOccluder.ellipsoid; @@ -2187,35 +2186,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 e094cd7f3de7..d53cf10b1ac9 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 34fd5847aaa0..733907695de2 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 2656f5817517..307fa36c8e39 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,8 +634,9 @@ 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", @@ -650,8 +651,9 @@ 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", @@ -668,8 +670,9 @@ 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 7d6136d28357..3e517c1a1fa1 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 5983a38e3e89..dccdae0df9af 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 08e79ac95d9e..5032408bdc38 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,8 +63,10 @@ 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 } @@ -96,8 +98,10 @@ TileImagery.prototype.processStateMachine = function ( if (defined(ancestor)) { ancestor.addReference(); - this.textureTranslationAndScale = - imageryLayer._calculateTextureTranslationAndScale(tile, this); + this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale( + tile, + this + ); } } @@ -113,7 +117,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 b195701fbe0f..1797c545e702 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,10 +151,9 @@ 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; } /** @@ -180,18 +179,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); @@ -216,7 +215,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( options, tmsResource, xmlResource, - provider, + provider ) { const tileFormatRegex = /tileformat/i; const tileSetRegex = /tileset/i; @@ -255,7 +254,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( undefined, provider, provider.errorEvent, - message, + message ); } @@ -264,23 +263,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; @@ -307,7 +306,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( undefined, provider, provider.errorEvent, - message, + message ); } @@ -330,20 +329,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")) ); } @@ -369,7 +368,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( sw.longitude, sw.latitude, ne.longitude, - ne.latitude, + ne.latitude ); } @@ -379,7 +378,7 @@ TileMapServiceImageryProvider._metadataSuccess = function ( minimumLevel = calculateSafeMinimumDetailLevel( tilingScheme, rectangle, - minimumLevel, + minimumLevel ); const templateResource = tmsResource.getDerivedResource({ @@ -409,7 +408,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"); @@ -428,7 +427,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 c93462c1a578..c2a62d9643d9 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 2fe2b925ce45..40d60451f51f 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 df9102f73cfb..41d1652453c1 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 f5f23d1d6315..ef79ef3ec369 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 93c31eb5eede..8a12e8902b7c 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 2d52a8ef21cd..3bd7e3fbb94f 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 c73d3ba732c9..e013aa226581 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 useLogDepth = scene.frameState.useLogDepth; @@ -397,46 +397,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 uniformState = context.uniformState; - const framebuffer = passState.framebuffer; + const context = scene.context; + const uniformState = context.uniformState; + const framebuffer = passState.framebuffer; - passState.framebuffer = this._accumulationFBO.framebuffer; - this._accumulateCommand.execute(context, passState); + passState.framebuffer = this._accumulationFBO.framebuffer; + this._accumulateCommand.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); + } - uniformState.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); - const swapGlobeDepth = uniformState.globeDepthTexture; - uniformState.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, passState); - } + uniformState.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION); + const swapGlobeDepth = uniformState.globeDepthTexture; + uniformState.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, passState); + } - uniformState.globeDepthTexture = swapGlobeDepth; - passState.framebuffer = framebuffer; + uniformState.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) { @@ -467,7 +470,7 @@ function clear(translucentTileClassification, scene, passState) { translucentTileClassification._drawClassificationFBO.framebuffer; translucentTileClassification._clearColorCommand.execute( scene._context, - passState, + passState ); passState.framebuffer = framebuffer; @@ -477,7 +480,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 8ace4f73ed8f..e49bad844f57 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 48dcab645f46..9eee9536831b 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 30a07500ce07..657599492973 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 1975f60b6055..120a22db5801 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,10 +477,11 @@ 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; @@ -488,7 +489,7 @@ function initialize(content, arrayBuffer, byteOffset) { const polygonPositions = new Uint16Array( arrayBuffer, byteOffset, - numPolygonPositions, + numPolygonPositions ); byteOffset += positionByteLength; @@ -501,12 +502,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 ); } @@ -535,25 +536,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); @@ -570,7 +571,7 @@ function initialize(content, arrayBuffer, byteOffset) { const polylinePositions = new Uint16Array( arrayBuffer, byteOffset, - numPolylinePositions, + numPolylinePositions ); byteOffset += polylinePositionByteLength; @@ -582,7 +583,7 @@ function initialize(content, arrayBuffer, byteOffset) { rectangle, minHeight, maxHeight, - Ellipsoid.WGS84, + Ellipsoid.WGS84 ); examineVectorLines( decodedPositions, @@ -590,7 +591,7 @@ function initialize(content, arrayBuffer, byteOffset) { batchIds.polylines, batchTable, content.url, - examineVectorLinesFunction, + examineVectorLinesFunction ); } @@ -619,7 +620,7 @@ function initialize(content, arrayBuffer, byteOffset) { const pointPositions = new Uint16Array( arrayBuffer, byteOffset, - numberOfPoints * 3, + numberOfPoints * 3 ); byteOffset += pointsPositionByteLength; content._points = new Vector3DTilePoints({ @@ -662,7 +663,7 @@ Vector3DTileContent.prototype.getFeature = function (batchId) { throw new DeveloperError( `batchId is required and between zero and featuresLength - 1 (${ featuresLength - 1 - }).`, + }).` ); } //>>includeEnd('debug'); @@ -757,7 +758,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 682ca7dbb5e5..c6e4c7688079 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,14 +245,12 @@ 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)) { @@ -304,11 +302,10 @@ 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 e985e226bf20..7bea9c2c9022 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,8 +408,9 @@ 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; @@ -424,8 +425,9 @@ 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; @@ -448,7 +450,7 @@ Vector3DTilePoints.prototype.applyStyle = function (style, features) { if (defined(style.anchorLineColor)) { feature.anchorLineColor = style.anchorLineColor.evaluateColor( feature, - scratchColor6, + scratchColor6 ); } @@ -459,8 +461,9 @@ 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)) { @@ -472,8 +475,9 @@ 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 d11e4424a339..06a6d3de907e 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 d495a024efcd..781f568b5118 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 bb5cb4825a57..0f16df4a98fb 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,8 +498,9 @@ function createUniformMap(primitive, context) { }, }; - primitive._uniformMap = - primitive._batchTable.getUniformMapCallback()(uniformMap); + primitive._uniformMap = primitive._batchTable.getUniformMapCallback()( + uniformMap + ); } function copyIndicesCPU( @@ -509,7 +510,7 @@ function copyIndicesCPU( offsets, counts, batchIds, - batchIdLookUp, + batchIdLookUp ) { const sizeInBytes = indices.constructor.BYTES_PER_ELEMENT; @@ -523,7 +524,7 @@ function copyIndicesCPU( const subarray = new indices.constructor( indices.buffer, sizeInBytes * offset, - count, + count ); newIndices.set(subarray, currentOffset); @@ -552,7 +553,7 @@ function rebatchCPU(primitive, batchedIndices) { indexOffsets, indexCounts, current.batchIds, - batchIdLookUp, + batchIdLookUp ); current.offset = 0; @@ -568,7 +569,7 @@ function rebatchCPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp, + batchIdLookUp ); current.batchIds = current.batchIds.concat(next.batchIds); current.count = currentOffset - current.offset; @@ -581,7 +582,7 @@ function rebatchCPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp, + batchIdLookUp ); next.offset = offset; @@ -604,7 +605,7 @@ function copyIndicesGPU( offsets, counts, batchIds, - batchIdLookUp, + batchIdLookUp ) { const sizeInBytes = readBuffer.bytesPerIndex; @@ -619,7 +620,7 @@ function copyIndicesGPU( readBuffer, offset * sizeInBytes, currentOffset * sizeInBytes, - count * sizeInBytes, + count * sizeInBytes ); offsets[index] = currentOffset; @@ -647,7 +648,7 @@ function rebatchGPU(primitive, batchedIndices) { indexOffsets, indexCounts, current.batchIds, - batchIdLookUp, + batchIdLookUp ); current.offset = 0; @@ -663,7 +664,7 @@ function rebatchGPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp, + batchIdLookUp ); current.batchIds = current.batchIds.concat(next.batchIds); current.count = currentOffset - current.offset; @@ -676,7 +677,7 @@ function rebatchGPU(primitive, batchedIndices) { indexOffsets, indexCounts, next.batchIds, - batchIdLookUp, + batchIdLookUp ); next.offset = offset; next.count = currentOffset - offset; @@ -797,7 +798,7 @@ function createColorCommands(primitive, context) { const stencilDepthDerivedCommand = DrawCommand.shallowClone( stencilDepthCommand, - stencilDepthCommand.derivedCommands.tileset, + stencilDepthCommand.derivedCommands.tileset ); stencilDepthDerivedCommand.renderState = primitive._rsStencilDepthPass3DTiles; @@ -824,7 +825,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; @@ -853,7 +854,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; @@ -906,7 +907,7 @@ function createPickCommands(primitive) { const stencilDepthDerivedCommand = DrawCommand.shallowClone( stencilDepthCommand, - stencilDepthCommand.derivedCommands.tileset, + stencilDepthCommand.derivedCommands.tileset ); stencilDepthDerivedCommand.renderState = primitive._rsStencilDepthPass3DTiles; @@ -933,7 +934,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; @@ -1090,7 +1091,7 @@ Vector3DTilePrimitive.prototype.updateCommands = function (batchId, color) { offset: offset, count: count, batchIds: [batchId], - }), + }) ); const startIds = []; @@ -1121,7 +1122,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/VertexAttributeSemantic.js b/packages/engine/Source/Scene/VertexAttributeSemantic.js index c168997fca27..0225bf5d3fba 100644 --- a/packages/engine/Source/Scene/VertexAttributeSemantic.js +++ b/packages/engine/Source/Scene/VertexAttributeSemantic.js @@ -73,6 +73,20 @@ const VertexAttributeSemantic = { * @constant */ FEATURE_ID: "_FEATURE_ID", + /** + * Gaussian Splat Scale + * + * @type {string} + * @constant + */ + SCALE: "_SCALE", + /** + * Gaussian Splat Rotation + * + * @type {string} + * @constant + */ + ROTATION: "_ROTATION", }; function semanticToVariableName(semantic) { @@ -93,6 +107,10 @@ function semanticToVariableName(semantic) { return "weights"; case VertexAttributeSemantic.FEATURE_ID: return "featureId"; + case VertexAttributeSemantic.SCALE: + return "scale"; + case VertexAttributeSemantic.ROTATION: + return "rotation"; //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError("semantic is not a valid value."); @@ -124,6 +142,8 @@ VertexAttributeSemantic.hasSetIndex = function (semantic) { case VertexAttributeSemantic.JOINTS: case VertexAttributeSemantic.WEIGHTS: case VertexAttributeSemantic.FEATURE_ID: + case VertexAttributeSemantic.SCALE: + case VertexAttributeSemantic.ROTATION: return true; //>>includeStart('debug', pragmas.debug); default: @@ -172,6 +192,10 @@ VertexAttributeSemantic.fromGltfSemantic = function (gltfSemantic) { return VertexAttributeSemantic.WEIGHTS; case "_FEATURE_ID": return VertexAttributeSemantic.FEATURE_ID; + case "_SCALE": + return VertexAttributeSemantic.SCALE; + case "_ROTATION": + return VertexAttributeSemantic.ROTATION; } return undefined; @@ -241,6 +265,10 @@ VertexAttributeSemantic.getGlslType = function (semantic) { return "vec4"; case VertexAttributeSemantic.FEATURE_ID: return "int"; + case VertexAttributeSemantic.SCALE: + return "vec3"; + case VertexAttributeSemantic.ROTATION: + return "vec4"; //>>includeStart('debug', pragmas.debug); default: throw new DeveloperError("semantic is not a valid value."); diff --git a/packages/engine/Source/Scene/View.js b/packages/engine/Source/Scene/View.js index ec8cb870f681..bb7bcfbcbf7f 100644 --- a/packages/engine/Source/Scene/View.js +++ b/packages/engine/Source/Scene/View.js @@ -67,7 +67,7 @@ function View(scene, camera, viewport) { this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer(); this.oit = oit; this.translucentTileClassification = new TranslucentTileClassification( - context, + context ); /** * @type {PickDepth[]} @@ -96,11 +96,11 @@ const scratchPosition1 = new Cartesian3(); function cameraEqual(camera0, camera1, epsilon) { const maximumPositionComponent = Math.max( Cartesian3.maximumComponent( - Cartesian3.abs(camera0.position, scratchPosition0), + Cartesian3.abs(camera0.position, scratchPosition0) ), Cartesian3.maximumComponent( - Cartesian3.abs(camera1.position, scratchPosition1), - ), + Cartesian3.abs(camera1.position, scratchPosition1) + ) ); const scalar = 1 / Math.max(1, maximumPositionComponent); Cartesian3.multiplyByScalar(camera0.position, scalar, scratchPosition0); @@ -186,7 +186,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. @@ -202,7 +202,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 { @@ -213,7 +213,7 @@ function updateFrustums(view, scene, near, far) { if (!defined(frustumCommands)) { frustumCommands = frustumCommandsList[m] = new FrustumCommands( curNear, - curFar, + curFar ); } else { frustumCommands.near = curNear; @@ -349,7 +349,7 @@ View.prototype.createPotentiallyVisibleSet = function (scene) { const nearFarInterval = boundingVolume.computePlaneDistances( positionWC, directionWC, - scratchNearFarInterval, + scratchNearFarInterval ); commandNear = nearFarInterval.start; commandFar = nearFarInterval.stop; diff --git a/packages/engine/Source/Scene/VoxelBoxShape.js b/packages/engine/Source/Scene/VoxelBoxShape.js index fb17d83cc36d..6cbe40f7e026 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 b87d0e235bde..5880f71c0ac6 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 451be03d2493..4d566c89d0d0 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 7418193bdfc9..eb158d9ccc96 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 efa1fac04658..52cc0e1523b8 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,23 +469,26 @@ 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 ); } @@ -495,8 +498,9 @@ 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) @@ -512,7 +516,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLongitude = Cartesian2.fromElements( 0.0, 1.0, - shaderUniforms.ellipsoidUvToShapeUvLongitude, + shaderUniforms.ellipsoidUvToShapeUvLongitude ); } else { const scale = defaultLongitudeRange / shapeLongitudeRange; @@ -521,7 +525,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLongitude = Cartesian2.fromElements( scale, offset, - shaderUniforms.ellipsoidUvToShapeUvLongitude, + shaderUniforms.ellipsoidUvToShapeUvLongitude ); } } @@ -531,22 +535,24 @@ 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; @@ -564,7 +570,7 @@ VoxelEllipsoidShape.prototype.update = function ( uvShapeMinLongitude, uvShapeMaxLongitude, uvRenderLongitudeRangeZeroMid, - shaderUniforms.ellipsoidShapeUvLongitudeMinMaxMid, + shaderUniforms.ellipsoidShapeUvLongitudeMinMaxMid ); } @@ -572,20 +578,24 @@ 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; } } @@ -593,20 +603,24 @@ 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; } } @@ -614,7 +628,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidRenderLatitudeSinMinMax = Cartesian2.fromElements( Math.sin(renderMinBounds.y), Math.sin(renderMaxBounds.y), - shaderUniforms.ellipsoidRenderLatitudeSinMinMax, + shaderUniforms.ellipsoidRenderLatitudeSinMinMax ); } @@ -635,7 +649,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLatitude = Cartesian2.fromElements( 0.0, 1.0, - shaderUniforms.ellipsoidUvToShapeUvLatitude, + shaderUniforms.ellipsoidUvToShapeUvLatitude ); } else { const defaultLatitudeRange = DefaultMaxBounds.y - DefaultMinBounds.y; @@ -645,7 +659,7 @@ VoxelEllipsoidShape.prototype.update = function ( shaderUniforms.ellipsoidUvToShapeUvLatitude = Cartesian2.fromElements( scale, offset, - shaderUniforms.ellipsoidUvToShapeUvLatitude, + shaderUniforms.ellipsoidUvToShapeUvLatitude ); } } @@ -673,7 +687,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForTile = function ( tileX, tileY, tileZ, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.number("tileLevel", tileLevel); @@ -697,19 +711,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( @@ -719,7 +733,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForTile = function ( this._ellipsoid, this._translation, this._rotation, - result, + result ); }; @@ -741,7 +755,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( spatialNode, tileDimensions, tileUv, - result, + result ) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object("spatialNode", spatialNode); @@ -754,12 +768,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( @@ -767,15 +781,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( @@ -784,17 +798,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( @@ -804,7 +818,7 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function ( this._ellipsoid, this._translation, this._rotation, - result, + result ); }; @@ -831,20 +845,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; } @@ -860,8 +874,8 @@ VoxelEllipsoidShape.DefaultMinBounds = Object.freeze( new Cartesian3( -CesiumMath.PI, -CesiumMath.PI_OVER_TWO, - -Ellipsoid.WGS84.minimumRadius, - ), + -Ellipsoid.WGS84.minimumRadius + ) ); /** @@ -875,8 +889,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 0942fbb817a4..8a83c3ea2512 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 3e23d213f0c7..c6814a95acbe 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 b7e02d06f1dd..0cc1db7b2d22 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,8 +594,9 @@ function loadAndUnload(that, frameState) { while (priorityQueue.length > 0) { highPriorityKeyframeNode = priorityQueue.removeMaximum(); highPriorityKeyframeNode.highPriorityFrameNumber = frameNumber; - highPriorityKeyframeNodes[highPriorityKeyframeNodeCount] = - highPriorityKeyframeNode; + highPriorityKeyframeNodes[ + highPriorityKeyframeNodeCount + ] = highPriorityKeyframeNode; highPriorityKeyframeNodeCount++; } @@ -647,7 +648,7 @@ function loadAndUnload(that, frameState) { const discardNode = keyframeNodesInMegatexture[addNodeIndex]; discardNode.spatialNode.destroyKeyframeNode( discardNode, - that.megatextures, + that.megatextures ); } else { addNodeIndex = keyframeNodesInMegatextureCount + addedCount; @@ -655,7 +656,7 @@ function loadAndUnload(that, frameState) { } highPriorityKeyframeNode.spatialNode.addKeyframeNodeToMegatextures( highPriorityKeyframeNode, - that.megatextures, + that.megatextures ); keyframeNodesInMegatexture[addNodeIndex] = highPriorityKeyframeNode; } @@ -675,24 +676,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 ); } @@ -707,7 +708,7 @@ function printDebugInformation( that, loadAndUnloadTimeMs, generateOctreeTimeMs, - totalTimeMs, + totalTimeMs ) { const keyframeCount = that._keyframeCount; const rootNode = that.rootNode; @@ -782,7 +783,7 @@ function printDebugInformation( `ALL: ${totalTimeMsRounded}`; console.log( - `${loadedKeyframeStatistics} || ${loadStateStatistics} || ${timerStatistics}`, + `${loadedKeyframeStatistics} || ${loadStateStatistics} || ${timerStatistics}` ); } @@ -854,7 +855,7 @@ function generateOctree(that, sampleCount, levelBlendFactor) { childOctreeIndex, childEntryIndex, parentOctreeIndex, - parentEntryIndex, + parentEntryIndex ) { let hasRenderableChildren = false; if (defined(node.children)) { @@ -886,7 +887,7 @@ function generateOctree(that, sampleCount, levelBlendFactor) { childOctreeIndex, childEntryIndex, parentOctreeIndex, - parentEntryIndex + cc, + parentEntryIndex + cc ); } } else { @@ -940,14 +941,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 ); } } @@ -985,7 +986,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)); @@ -1027,7 +1028,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)); @@ -1042,7 +1043,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; @@ -1083,7 +1084,7 @@ VoxelTraversal.getApproximateTextureMemoryByteLength = function ( tileCount, dimensions, types, - componentTypes, + componentTypes ) { let textureMemoryByteLength = 0; @@ -1093,13 +1094,12 @@ 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 09fe189a73d8..f5277f2eeec2 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 690a7ea59b13..1ee3c2002504 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 19f67111ccca..ba8aba81bb37 100644 --- a/packages/engine/Source/Scene/buildVoxelDrawCommands.js +++ b/packages/engine/Source/Scene/buildVoxelDrawCommands.js @@ -23,8 +23,11 @@ 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. @@ -38,16 +41,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]); } @@ -59,12 +62,13 @@ 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, @@ -98,7 +102,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; @@ -106,7 +110,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 d77d02a10400..0a984cb7cb35 100644 --- a/packages/engine/Source/Scene/computeFlyToLocationForRectangle.js +++ b/packages/engine/Source/Scene/computeFlyToLocationForRectangle.js @@ -45,11 +45,10 @@ 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) { @@ -69,6 +68,5 @@ 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 5c2bfa725486..a9340b81d3d5 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 94d0e8a39ee3..544a1d67f6c7 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 f762d748dc36..eee6c6abb61d 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 e3b2908277f3..08b4b019c7ad 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 c5d8175dd2a0..5c3086e11b33 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 dd8e96327d2d..db20826686ba 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 c91a3df7ae93..f455afdf9c94 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 36ab52e85b8f..aad46fc83bab 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 2dbc355196e6..5b3e71f61eab 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 690d542cf4f5..d17d9819b598 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 6105f587abaf..26cb21abec7f 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,12 +246,13 @@ 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++; } @@ -284,7 +285,7 @@ function transcodeBinaryPropertiesAsPropertyAttributes( className, binaryProperties, binaryBody, - customAttributeOutput, + customAttributeOutput ) { const classProperties = {}; const propertyAttributeProperties = {}; @@ -301,7 +302,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.` ); } @@ -345,7 +346,7 @@ function transcodeBinaryPropertiesAsPropertyAttributes( attributeTypedArray = binaryAccessor.createArrayBufferView( binaryBody.buffer, binaryBody.byteOffset + property.byteOffset, - featureCount, + featureCount ); } @@ -353,8 +354,9 @@ 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 || @@ -362,12 +364,13 @@ 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 9d20d691a5d9..481ed2b0606b 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 415de8929f3a..1e401fe7c277 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 cc90a6db5ead..4c91b7f120d2 100644 --- a/packages/engine/Source/Scene/processVoxelProperties.js +++ b/packages/engine/Source/Scene/processVoxelProperties.js @@ -15,8 +15,13 @@ 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); @@ -24,14 +29,14 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addDefine( "METADATA_COUNT", attributeLength, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); if (hasStatistics) { shaderBuilder.addDefine( "STATISTICS", undefined, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); } @@ -44,7 +49,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( propertyStatisticsStructId, propertyStatisticsStructName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); const glslType = getGlslType(type); shaderBuilder.addStructField(propertyStatisticsStructId, glslType, "min"); @@ -58,7 +63,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( statisticsStructId, statisticsStructName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -67,7 +72,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStructField( statisticsStructId, propertyStructName, - propertyFieldName, + propertyFieldName ); } @@ -78,12 +83,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]; @@ -102,27 +107,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" ); } @@ -133,7 +138,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( voxelStructId, voxelStructName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -158,17 +163,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 @@ -178,7 +183,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addStruct( propertiesStructId, propertiesStructName, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); for (let i = 0; i < attributeLength; i++) { const name = names[i]; @@ -195,7 +200,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} clearProperties()`, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} ${propertiesFieldName};`, @@ -220,7 +225,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} sumProperties(${propertiesStructName} propertiesA, ${propertiesStructName} propertiesB)`, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} ${propertiesFieldName};`, @@ -242,7 +247,7 @@ function processVoxelProperties(renderResources, primitive) { shaderBuilder.addFunction( functionId, `${propertiesStructName} scaleProperties(${propertiesStructName} ${propertiesFieldName}, float scale)`, - ShaderDestination.FRAGMENT, + ShaderDestination.FRAGMENT ); shaderBuilder.addFunctionLines(functionId, [ `${propertiesStructName} scaledProperties = ${propertiesFieldName};`, @@ -262,7 +267,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};`, @@ -284,7 +289,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]; @@ -300,7 +305,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]; @@ -312,10 +317,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 )};`, ]); } @@ -328,7 +333,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/Shaders/Builtin/Constants/passGaussianSplats.glsl b/packages/engine/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl new file mode 100644 index 000000000000..e064b7c2a669 --- /dev/null +++ b/packages/engine/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl @@ -0,0 +1,9 @@ +/** + * The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS} + * + * @name czm_passGaussianSplats + * @glslConstant + * + * @see czm_pass + */ +const float czm_passGaussianSplats = 10.0; diff --git a/packages/engine/Source/Shaders/Builtin/Constants/passOverlay.glsl b/packages/engine/Source/Shaders/Builtin/Constants/passOverlay.glsl index 6aea11eb1ee0..b7c391e0165a 100644 --- a/packages/engine/Source/Shaders/Builtin/Constants/passOverlay.glsl +++ b/packages/engine/Source/Shaders/Builtin/Constants/passOverlay.glsl @@ -6,4 +6,4 @@ * * @see czm_pass */ -const float czm_passOverlay = 10.0; +const float czm_passOverlay = 11.0; diff --git a/packages/engine/Source/Shaders/Model/GaussianSplatFS.glsl b/packages/engine/Source/Shaders/Model/GaussianSplatFS.glsl new file mode 100644 index 000000000000..0af1ce0437ea --- /dev/null +++ b/packages/engine/Source/Shaders/Model/GaussianSplatFS.glsl @@ -0,0 +1,8 @@ +void gaussianSplatStage(inout vec4 color, in ProcessedAttributes attributes) { + mediump float A = dot(v_vertPos, v_vertPos); + if(A > 1.0) + discard; + mediump float B = exp(-A * 4.0) * (v_splatColor.a); + color = vec4(v_splatColor.rgb * B, B); +} + diff --git a/packages/engine/Source/Shaders/Model/GaussianSplatVS.glsl b/packages/engine/Source/Shaders/Model/GaussianSplatVS.glsl new file mode 100644 index 000000000000..8c510a2b1c94 --- /dev/null +++ b/packages/engine/Source/Shaders/Model/GaussianSplatVS.glsl @@ -0,0 +1,202 @@ +#ifndef HAS_SPLAT_TEXTURE + +void calcCov3D(vec3 scale, vec4 rot, out float[6] cov3D) +{ + mat3 S = mat3( + u_splatScale * scale[0], 0, 0, + 0, u_splatScale * scale[1], 0, + 0, 0, u_splatScale * scale[2] + ); + + float r = rot.w; + float x = rot.x; + float y = rot.y; + float z = rot.z; + + // Compute rotation matrix from quaternion + mat3 R = mat3( + 1. - 2. * (y * y + z * z), + 2. * (x * y - r * z), + 2. * (x * z + r * y), + 2. * (x * y + r * z), + 1. - 2. * (x * x + z * z), + 2. * (y * z - r * x), + 2. * (x * z - r * y), + 2. * (y * z + r * x), + 1. - 2. * (x * x + y * y) + ); + + mat3 M = S * R; + mat3 Sigma = transpose(M) * M; + + //we only need part of it, symmetric + cov3D = float[6]( + Sigma[0][0], Sigma[0][1], Sigma[0][2], + Sigma[1][1], Sigma[1][2], Sigma[2][2] + ); + +} + +vec3 calcCov2D(vec3 worldPos, float focal_x, float focal_y, float tan_fovx, float tan_fovy, float[6] cov3D, mat4 viewmatrix) { + vec4 t = viewmatrix * vec4(worldPos, 1.0); + + float limx = 1.3 * tan_fovx; + float limy = 1.3 * tan_fovy; + float txtz = t.x / t.z; + float tytz = t.y / t.z; + t.x = min(limx, max(-limx, txtz)) * t.z; + t.y = min(limy, max(-limy, tytz)) * t.z; + + mat3 J = mat3( + focal_x / t.z, 0, -(focal_x * t.x) / (t.z * t.z), + 0, focal_y / t.z, -(focal_y * t.y) / (t.z * t.z), + 0, 0, 0 + ); + + mat3 W = mat3( + viewmatrix[0][0], viewmatrix[1][0], viewmatrix[2][0], + viewmatrix[0][1], viewmatrix[1][1], viewmatrix[2][1], + viewmatrix[0][2], viewmatrix[1][2], viewmatrix[2][2] + ); + mat3 T = W * J; + mat3 Vrk = mat3( + cov3D[0], cov3D[1], cov3D[2], + cov3D[1], cov3D[3], cov3D[4], + cov3D[2], cov3D[4], cov3D[5] + ); + + mat3 cov = transpose(T) * transpose(Vrk) * T; + + cov[0][0] += .3; + cov[1][1] += .3; + return vec3(cov[0][0], cov[0][1], cov[1][1]); +} + +vec3 dequantizePos(uvec3 qPos) { + vec3 normalizedPos = vec3(qPos) / 65535.0; + + vec4 worldPos = u_scalingMatrix * vec4(normalizedPos, 1.0); + + return vec3(worldPos); +} + + +void gaussianSplatStage(ProcessedAttributes attributes, inout vec4 positionClip) { + mat4 viewMatrix = czm_modelView; + + vec3 deqPos = dequantizePos(a_splatPosition); + vec4 clipPosition = czm_modelViewProjection * vec4(deqPos ,1.0); + positionClip = clipPosition; + + float[6] cov3D; + calcCov3D(attributes.scale, attributes.rotation, cov3D); + vec3 cov = calcCov2D(deqPos, u_focalX, u_focalY, u_tan_fovX, u_tan_fovY, cov3D, viewMatrix); + + float mid = (cov.x + cov.z) / 2.0; + float radius = length(vec2((cov.x - cov.z) / 2.0, cov.y)); + float lambda1 = mid + radius, lambda2 = mid - radius; + + if(lambda2 < 0.0) return; + vec2 diagonalVector = normalize(vec2(cov.y, lambda1 - cov.x)); + vec2 v1 = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector; + vec2 v2 = min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x); + + vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.; + positionClip += vec4((corner.x * v1 + corner.y * v2) * 4.0 / czm_viewport.zw * positionClip.w, 0, 0); + positionClip.z = clamp(positionClip.z, -abs(positionClip.w), abs(positionClip.w)); + v_vertPos = corner ; + v_splatColor = a_splatColor; +} + +#else + +vec4 calcCovVectors(vec3 worldPos, mat3 Vrk, mat3 viewmatrix) { + vec4 t = vec4(worldPos, 1.0); + float focal = czm_viewport.z * czm_projection[0][0]; + + float J1 = focal / t.z; + vec2 J2 = -J1 / t.z * t.xy; + mat3 J = mat3( + J1, 0.0, J2.x, + 0.0, J1, J2.y, + 0.0, 0.0, 0.0 + ); + + mat3 T = viewmatrix * J; + mat3 cov = transpose(T) * Vrk * T; + + float diagonal1 = cov[0][0] + .3; + float offDiagonal = cov[0][1]; + float diagonal2 = cov[1][1] + .3; + + float mid = 0.5 * (diagonal1 + diagonal2); + float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal)); + float lambda1 = mid + radius; + float lambda2 = max(mid - radius, 0.1); + + vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1)); + + return vec4( + min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector, + min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x) + ); +} + +highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0); + +vec4 dequantizePos(uvec4 qPos) { + vec3 normalizedPos = vec3(qPos) / 65535.0; + + vec4 worldPos = u_scalingMatrix * vec4(normalizedPos, 1.0); + + return worldPos; +} + +void gaussianSplatStage(ProcessedAttributes attributes, inout vec4 positionClip) { + uint texIdx = uint(a_splatIndex); + ivec2 posCoord = ivec2((texIdx & 0x3ffu) << 1, texIdx >> 10); + vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) ); + //vec4 splatPosition = dequantizePos(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))); + + vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0); + vec4 clipPosition = czm_projection * splatViewPos; + + float clip = 1.2 * clipPosition.w; + if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip || + clipPosition.y < -clip || clipPosition.y > clip) { + positionClip = vec4(0.0, 0.0, 2.0, 1.0); + return; + } + + ivec2 covCoord = ivec2(((texIdx & 0x3ffu) << 1) | 1u, texIdx >> 10); + uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0)); + + positionClip = clipPosition; + + vec2 u1 = unpackHalf2x16(covariance.x) ; + vec2 u2 = unpackHalf2x16(covariance.y); + vec2 u3 = unpackHalf2x16(covariance.z); + mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y); + + vec4 covVectors = calcCovVectors( + splatViewPos.xyz, + Vrk, + mat3(transpose(czm_modelView)) + ); + + if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) { + gl_Position = discardVec; + return; + } + + vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.; + + positionClip += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * positionClip.w, 0, 0); + positionClip.z = clamp(positionClip.z, -abs(positionClip.w), abs(positionClip.w)); + + v_vertPos = corner ; + v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0; +} + + +#endif diff --git a/packages/engine/Source/Shaders/Model/ModelFS.glsl b/packages/engine/Source/Shaders/Model/ModelFS.glsl index 0500c0b9f1ff..fd73d6f97faf 100644 --- a/packages/engine/Source/Shaders/Model/ModelFS.glsl +++ b/packages/engine/Source/Shaders/Model/ModelFS.glsl @@ -1,5 +1,6 @@ precision highp float; + czm_modelMaterial defaultModelMaterial() { czm_modelMaterial material; @@ -79,7 +80,7 @@ void main() // When not picking metadata END //======================================================================== - #else + #else //======================================================================== // When picking metadata START @@ -111,9 +112,14 @@ void main() atmosphereStage(color, attributes); #endif + #ifdef HAS_GAUSSIAN_SPLATS + gaussianSplatStage(color, attributes); + #endif + #endif // When not picking metadata END //======================================================================== out_FragColor = color; } + diff --git a/packages/engine/Source/Shaders/Model/ModelVS.glsl b/packages/engine/Source/Shaders/Model/ModelVS.glsl index b95b329f59ff..a055a69e830c 100644 --- a/packages/engine/Source/Shaders/Model/ModelVS.glsl +++ b/packages/engine/Source/Shaders/Model/ModelVS.glsl @@ -134,15 +134,19 @@ void main() #endif #ifdef PRIMITIVE_TYPE_POINTS - #ifdef HAS_CUSTOM_VERTEX_SHADER - gl_PointSize = vsOutput.pointSize; - #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) - gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); - #else - gl_PointSize = 1.0; - #endif - gl_PointSize *= show; + #ifdef HAS_CUSTOM_VERTEX_SHADER + gl_PointSize = vsOutput.pointSize; + #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) + gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); + #else + gl_PointSize = 1.0; + #endif + gl_PointSize *= show; + #endif + + #ifdef HAS_GAUSSIAN_SPLATS + gaussianSplatStage(attributes, positionClip); #endif gl_Position = show * positionClip; diff --git a/packages/engine/Source/Shaders/Model/PointCloudStylingStageVS.glsl b/packages/engine/Source/Shaders/Model/PointCloudStylingStageVS.glsl index e3fd4cfc0f9f..0d46fb382963 100644 --- a/packages/engine/Source/Shaders/Model/PointCloudStylingStageVS.glsl +++ b/packages/engine/Source/Shaders/Model/PointCloudStylingStageVS.glsl @@ -42,4 +42,4 @@ float pointCloudBackFaceCullingStage() { return 1.0; #endif } -#endif \ No newline at end of file +#endif diff --git a/packages/engine/Source/Widget/CesiumWidget.js b/packages/engine/Source/Widget/CesiumWidget.js index 3d01ca4c3c4d..20b2e7172ec2 100644 --- a/packages/engine/Source/Widget/CesiumWidget.js +++ b/packages/engine/Source/Widget/CesiumWidget.js @@ -192,8 +192,7 @@ 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(); @@ -222,7 +221,7 @@ function CesiumWidget(container, options) { const blurActiveElementOnCanvasFocus = defaultValue( options.blurActiveElementOnCanvasFocus, - true, + true ); if (blurActiveElementOnCanvasFocus) { @@ -248,7 +247,7 @@ function CesiumWidget(container, options) { const useBrowserRecommendedResolution = defaultValue( options.useBrowserRecommendedResolution, - true, + true ); this._element = element; @@ -304,7 +303,7 @@ function CesiumWidget(container, options) { scene.globe = globe; scene.globe.shadows = defaultValue( options.terrainShadows, - ShadowMode.RECEIVE_ONLY, + ShadowMode.RECEIVE_ONLY ); } @@ -349,7 +348,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') @@ -371,7 +370,7 @@ function CesiumWidget(container, options) { this._useDefaultRenderLoop = undefined; this.useDefaultRenderLoop = defaultValue( options.useDefaultRenderLoop, - true, + true ); this._targetFrameRate = undefined; @@ -574,7 +573,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'); @@ -694,7 +693,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 b2f78de13636..6ce02cf5c665 100644 --- a/packages/engine/Source/Workers/combineGeometry.js +++ b/packages/engine/Source/Workers/combineGeometry.js @@ -2,12 +2,13 @@ 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 be9f4796a31e..63c6e18b8e4a 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 e0522dd0c114..cb31541d49fd 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 d60c1658397f..11c13093b367 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 1967a82d1b7a..d5a13d71c009 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 d56e6c225087..f01eb9178541 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 e0a458a5a0cf..7e31d04505b2 100644 --- a/packages/engine/Source/Workers/createGeometry.js +++ b/packages/engine/Source/Workers/createGeometry.js @@ -60,9 +60,10 @@ 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; @@ -72,7 +73,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 3884975ce10b..78705ce7c8ad 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 804dde7d4c30..e537225ca3b1 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 f69ade704988..e701a1b397a3 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 269fae5dc3af..80a0ed6e6ef7 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 bd77fa8fac90..dabd1f3f698f 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 479538d69643..deffad5ab06e 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 2a00b1bb71cd..67887ed30989 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 417019747147..bdb4218c4d82 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 6b7289a8ee43..217d979408bc 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 9c64ca79791b..3770581d3557 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 967e431b9352..1002ce25a62f 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 fbffcb40ba47..7d41bcb9438c 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,15 +126,16 @@ 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) - @@ -278,7 +279,7 @@ function processBuffer( const index = indexOfEpsilon( quadBorderPoints, scratchCartographic, - Cartographic, + Cartographic ); if (index === -1) { quadBorderPoints.push(Cartographic.clone(scratchCartographic)); @@ -408,7 +409,7 @@ function processBuffer( westBorder, -percentage * rectangleWidth, true, - -percentage * rectangleHeight, + -percentage * rectangleHeight ); addSkirt( positions, @@ -420,7 +421,7 @@ function processBuffer( skirtOptions, southBorder, -percentage * rectangleHeight, - false, + false ); addSkirt( positions, @@ -433,7 +434,7 @@ function processBuffer( eastBorder, percentage * rectangleWidth, true, - percentage * rectangleHeight, + percentage * rectangleHeight ); addSkirt( positions, @@ -445,7 +446,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 @@ -462,7 +463,7 @@ function processBuffer( firstSkirtIndex, firstSkirtIndex, firstBorderIndex, - lastBorderIndex, + lastBorderIndex ); } @@ -475,17 +476,16 @@ 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,8 +612,9 @@ 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 @@ -640,7 +641,7 @@ function addSkirt( currentIndex, currentIndex, borderIndex, - lastBorderIndex, + lastBorderIndex ); } @@ -648,5 +649,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 feb5eed9b78a..743a62361ebd 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,8 +60,9 @@ function createVerticesFromQuantizedTerrainMesh( let southMercatorY; let oneOverMercatorHeight; if (includeWebMercatorT) { - southMercatorY = - WebMercatorProjection.geodeticLatitudeToMercatorAngle(south); + southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle( + south + ); oneOverMercatorHeight = 1.0 / (WebMercatorProjection.geodeticLatitudeToMercatorAngle(north) - @@ -71,11 +72,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); @@ -113,7 +114,7 @@ function createVerticesFromQuantizedTerrainMesh( const height = CesiumMath.lerp( minimumHeight, maximumHeight, - heightBuffer[i] / maxShort, + heightBuffer[i] / maxShort ); cartographicScratch.longitude = CesiumMath.lerp(west, east, u); @@ -134,7 +135,7 @@ function createVerticesFromQuantizedTerrainMesh( if (includeWebMercatorT) { webMercatorTs[i] = (WebMercatorProjection.geodeticLatitudeToMercatorAngle( - cartographicScratch.latitude, + cartographicScratch.latitude ) - southMercatorY) * oneOverMercatorHeight; @@ -150,41 +151,40 @@ 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 7b32c1187955..14d5d5b268c7 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 dff801ef29d2..59ad933dbc6e 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 89c1b130b94d..d81babacbfb4 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/gaussianSplatSorter.js b/packages/engine/Source/Workers/gaussianSplatSorter.js new file mode 100644 index 000000000000..8205fcdc5cd7 --- /dev/null +++ b/packages/engine/Source/Workers/gaussianSplatSorter.js @@ -0,0 +1,54 @@ +import createTaskProcessorWorker from "./createTaskProcessorWorker.js"; +//import defaultValue from "../Core/defaultValue.js"; +import defined from "../Core/defined.js"; +//import RuntimeError from "../Core/RuntimeError.js"; + +import { + initSync, + radix_sort_gaussians_attrs, + radix_sort_gaussians_indexes, +} from "cesiumjs-gsplat-utils"; + +//load built wasm modules for sorting. Ensure we can load webassembly and we support SIMD. +async function initWorker(parameters, transferableObjects) { + // Require and compile WebAssembly module, or use fallback if not supported + const wasmConfig = parameters.webAssemblyConfig; + if (defined(wasmConfig) && defined(wasmConfig.wasmBinary)) { + initSync(wasmConfig.wasmBinary); + return true; + } +} + +function generateGaussianSortWorker(parameters, transferableObjects) { + // Handle initialization + const wasmConfig = parameters.webAssemblyConfig; + if (defined(wasmConfig)) { + return initWorker(parameters, transferableObjects); + } + + const { primitive, sortType } = parameters; + + if (sortType === "Attribute") { + return radix_sort_gaussians_attrs( + primitive.attributes, + primitive.modelView, + primitive.count, + ); + } else if (sortType === "Index") { + return radix_sort_gaussians_indexes( + primitive.positions, + primitive.modelView, + 2048, + primitive.count, + ); + } else if (sortType === "SIMD Index") { + return radix_sort_gaussians_indexes( + primitive.positions, + primitive.modelView, + 2048, + primitive.count, + ); + } +} + +export default createTaskProcessorWorker(generateGaussianSortWorker); diff --git a/packages/engine/Source/Workers/gaussianSplatTextureGenerator.js b/packages/engine/Source/Workers/gaussianSplatTextureGenerator.js new file mode 100644 index 000000000000..cf283730bddc --- /dev/null +++ b/packages/engine/Source/Workers/gaussianSplatTextureGenerator.js @@ -0,0 +1,34 @@ +import createTaskProcessorWorker from "./createTaskProcessorWorker.js"; +//import defaultValue from "../Core/defaultValue.js"; +import defined from "../Core/defined.js"; +//import RuntimeError from "../Core/RuntimeError.js"; + +import { initSync, generate_texture_from_attrs } from "cesiumjs-gsplat-utils"; + +//load built wasm modules for sorting. Ensure we can load webassembly and we support SIMD. +async function initWorker(parameters, transferableObjects) { + // Require and compile WebAssembly module, or use fallback if not supported + const wasmConfig = parameters.webAssemblyConfig; + if (defined(wasmConfig) && defined(wasmConfig.wasmBinary)) { + initSync(wasmConfig.wasmBinary); + return true; + } +} + +async function generateSplatTextureWorker(parameters, transferableObjects) { + const wasmConfig = parameters.webAssemblyConfig; + if (defined(wasmConfig)) { + return initWorker(parameters, transferableObjects); + } + + const { attributes, count } = parameters; + return generate_texture_from_attrs( + attributes.positions, + attributes.scales, + attributes.rotations, + attributes.colors, + count, + ); +} + +export default createTaskProcessorWorker(generateSplatTextureWorker); diff --git a/packages/engine/Source/Workers/transcodeKTX2.js b/packages/engine/Source/Workers/transcodeKTX2.js index b92a5a9c240d..9926d303b070 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 aa4eb9b1eb89..3cebe76ca23f 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 fbe235b64a28..b38752da64cd 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,31 +368,30 @@ 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) { @@ -414,7 +413,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { const indicesTypedArray = IndexDatatype.createTypedArray( uBuffer.length, - indices, + indices ); let encodedNormals; @@ -423,7 +422,7 @@ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) { transferableObjects.push( vertices.buffer, indicesTypedArray.buffer, - normalArray.buffer, + normalArray.buffer ); encodedNormals = normalArray.buffer; } else { @@ -476,7 +475,7 @@ Vertex.prototype.initializeIndexed = function ( vBuffer, heightBuffer, normalBuffer, - index, + index ) { this.uBuffer = uBuffer; this.vBuffer = vBuffer; @@ -491,7 +490,7 @@ Vertex.prototype.initializeIndexed = function ( Vertex.prototype.initializeFromClipResult = function ( clipResult, index, - vertices, + vertices ) { let nextIndex = index + 1; @@ -562,18 +561,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); @@ -617,7 +616,7 @@ function addClippedPolygon( vertexMap, clipped, triangleVertices, - hasVertexNormals, + hasVertexNormals ) { if (clipped.length === 0) { return; @@ -629,7 +628,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 14665fef2327..13328b93a4d8 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 c59001bc02a8..970fdfd9b766 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,21 +196,22 @@ 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); }); @@ -219,15 +220,16 @@ 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); }); @@ -235,36 +237,39 @@ 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(); }); @@ -273,25 +278,27 @@ 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 ); }); @@ -299,8 +306,9 @@ 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); }); @@ -310,7 +318,7 @@ describe("Core/ArcGISTiledElevationTerrainProvider", function () { metadata.spatialReference.latestWkid = 1234; await expectAsync( - ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl), + ArcGISTiledElevationTerrainProvider.fromUrl(baseUrl) ).toBeRejectedWithError(RuntimeError, "Invalid spatial reference"); }); @@ -319,15 +327,16 @@ 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(); @@ -338,8 +347,9 @@ 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(); @@ -350,8 +360,9 @@ 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(); @@ -366,14 +377,15 @@ 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; @@ -398,7 +410,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 1a9237e6f8b1..c288d01c4d1f 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,7 +1233,14 @@ 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]; @@ -1241,7 +1248,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]); @@ -1250,7 +1257,14 @@ 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]; @@ -1258,7 +1272,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]); @@ -1275,7 +1289,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 d01e1155ec3d..0a7ced5342d9 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 cf707183a611..9d5dbccfda02 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 f10b3410c341..9046e54b0523 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,9 +291,10 @@ 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 82283f4a7d60..2ff3b3ade619 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,26 +783,27 @@ 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); }); @@ -815,8 +816,9 @@ 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)); } @@ -824,19 +826,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); }); @@ -993,7 +995,7 @@ describe("Core/BoundingSphere", function () { expect(function () { BoundingSphere.computePlaneDistances( new BoundingSphere(), - new Cartesian3(), + new Cartesian3() ); }).toThrowDeveloperError(); }); @@ -1013,15 +1015,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 @@ -1042,7 +1044,7 @@ describe("Core/BoundingSphere", function () { rectangle, projection, minHeight, - maxHeight, + maxHeight ); // Test that the corners are inside the bounding sphere. @@ -1091,56 +1093,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); }); @@ -1155,6 +1157,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 68d6d490b064..80ef2af551a1 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 080a2ff9a3cf..90a7c3a866c9 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 98e27de8fc27..d95b5e0fd096 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 d2cae1feef9d..09d9b13ff264 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,13 +1349,18 @@ 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); }); @@ -1404,7 +1409,7 @@ describe("Core/Cartesian3", function () { const actual = Cartesian3.fromRadiansArray( [lon1, lat1, lon2, lat2], ellipsoid, - result, + result ); const expected = ellipsoid.cartographicArrayToCartesianArray([ new Cartographic(lon1, lat1), @@ -1422,13 +1427,18 @@ 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); }); @@ -1483,13 +1493,21 @@ 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); }); @@ -1549,7 +1567,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), @@ -1567,14 +1585,21 @@ 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); }); @@ -1704,21 +1729,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(); }); @@ -1728,6 +1753,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 41bea584dc9b..b9146991493a 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 1cc60b71a198..98fb8ae18020 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 221282c89b43..cd281154bd8e 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 3384a766e325..4dd08e164df3 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 9422bc626d51..c89c43b83545 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,14 +866,15 @@ 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); @@ -894,7 +895,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.metadataavailability.terrain", @@ -902,14 +903,15 @@ 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; @@ -934,7 +936,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { // Do nothing, so requests never complete deferreds.push(deferred); @@ -978,7 +980,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.terrain", @@ -986,7 +988,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred, + deferred ); }; @@ -1017,7 +1019,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.metadataavailability.terrain", @@ -1025,14 +1027,15 @@ 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(); @@ -1049,7 +1052,7 @@ describe("Core/CesiumTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { // Just return any old file, as long as its big enough Resource._DefaultImplementations.loadWithXhr( @@ -1058,7 +1061,7 @@ describe("Core/CesiumTerrainProvider", function () { method, data, headers, - deferred, + deferred ); }; @@ -1075,17 +1078,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 d1a0c7c333ed..78cc3929c4df 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 5124c2e720b5..1f8a92ae0e1f 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 be69c6277a6f..48a3e97c1717 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 abf3282a25aa..e2557eb6bfa9 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 157b2781e0d3..96ab7d124170 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,9 +939,10 @@ 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 b1047d3f1bb0..10957085f84b 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 3ccf284c23c2..11e767ab5081 100644 --- a/packages/engine/Specs/Core/CoplanarPolygonGeometrySpec.js +++ b/packages/engine/Specs/Core/CoplanarPolygonGeometrySpec.js @@ -26,10 +26,20 @@ 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(); }); @@ -38,9 +48,17 @@ 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(); }); @@ -51,14 +69,19 @@ 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(); }); @@ -68,9 +91,20 @@ 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); @@ -82,9 +116,20 @@ 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; @@ -102,9 +147,20 @@ 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); @@ -118,13 +174,28 @@ 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, @@ -167,7 +238,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); @@ -204,7 +275,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); @@ -213,6 +284,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 ee579d803f93..90c922124f6b 100644 --- a/packages/engine/Specs/Core/CoplanarPolygonOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/CoplanarPolygonOutlineGeometrySpec.js @@ -19,10 +19,20 @@ 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(); }); @@ -31,9 +41,17 @@ 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(); }); @@ -44,14 +62,19 @@ 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(); }); @@ -60,9 +83,20 @@ 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); @@ -70,13 +104,28 @@ 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 26c91005b708..c8d4c6efd2d9 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,11 +199,16 @@ 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 @@ -215,11 +220,16 @@ 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); @@ -231,11 +241,18 @@ 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 @@ -252,11 +269,18 @@ 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); @@ -268,14 +292,20 @@ 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 @@ -287,12 +317,17 @@ 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); @@ -311,14 +346,24 @@ 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, }); @@ -330,14 +375,19 @@ 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, @@ -347,11 +397,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); @@ -361,7 +411,12 @@ 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, @@ -377,7 +432,12 @@ 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, }; @@ -395,7 +455,12 @@ 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, @@ -407,27 +472,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 ); }); @@ -452,7 +517,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 5d8e84dee9ce..53ea95769ecf 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,11 +142,16 @@ 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); @@ -157,11 +162,16 @@ 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); @@ -172,11 +182,18 @@ 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 @@ -191,11 +208,18 @@ 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); @@ -212,28 +236,41 @@ 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]); @@ -255,7 +292,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 e904e4d276a7..d991b148028c 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 012574abf77c..226cad01729b 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,12 +117,11 @@ 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 137b7a43faa2..2b00afbfe928 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,7 +186,17 @@ 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 55bb1c388bc3..1868d8cf7135 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,23 +121,28 @@ 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 fe9db086a205..2a815fde929a 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,10 +26,9 @@ 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); @@ -47,7 +46,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(); }); @@ -56,7 +55,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); }); @@ -64,8 +63,10 @@ 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 2eebd13e1b21..c726947622c6 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 c93568689067..23e41e19ee2e 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 838f1aaa1fc1..06a1463fb84b 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 c4be63eb0d56..8e4618e9fbee 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 20b9b4572831..3b7c1edb274f 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 8165e22fa2be..7800e7afbba2 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,8 +353,25 @@ 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 c71224601d3b..e24be1fefa9f 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,30 +176,42 @@ 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(); @@ -227,11 +239,24 @@ 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 add1998ace05..afc652627b08 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,12 +973,13 @@ 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 ); }); @@ -990,50 +991,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); }); @@ -1045,7 +1046,7 @@ describe("Core/EllipsoidRhumbLine", function () { const midpointUsingInterpolation = rhumb.interpolateUsingFraction(0.5); const midpointUsingIntersection = rhumb.findIntersectionWithLatitude( - midpointUsingInterpolation.latitude, + midpointUsingInterpolation.latitude ); expect(midpointUsingIntersection).not.toBeDefined(); @@ -1059,14 +1060,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); }); @@ -1074,12 +1075,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 40f470cbfed9..416d589039ee 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,11 +110,12 @@ 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 ); }); @@ -123,12 +124,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 ); }); @@ -137,7 +138,7 @@ describe("Core/Ellipsoid", function () { const returnedResult = ellipsoid.geodeticSurfaceNormal(spaceCartesian); expect(returnedResult).toEqualEpsilon( spaceCartesianGeodeticSurfaceNormal, - CesiumMath.EPSILON15, + CesiumMath.EPSILON15 ); }); @@ -152,12 +153,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 ); }); @@ -172,7 +173,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); @@ -187,11 +188,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 ); }); @@ -201,18 +202,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 ); }); @@ -221,7 +222,7 @@ describe("Core/Ellipsoid", function () { const returnedResult = ellipsoid.cartesianToCartographic(surfaceCartesian); expect(returnedResult).toEqualEpsilon( surfaceCartographic, - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -230,12 +231,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 ); }); @@ -243,10 +244,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); }); @@ -254,7 +255,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(); }); @@ -274,11 +275,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 ); }); @@ -288,7 +289,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); @@ -326,7 +327,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); @@ -338,7 +339,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(); @@ -376,7 +377,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); @@ -388,13 +389,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); @@ -422,7 +423,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); @@ -432,8 +433,9 @@ 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); }); @@ -444,7 +446,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); @@ -593,10 +595,11 @@ 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); }); @@ -604,12 +607,13 @@ 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); }); @@ -617,11 +621,12 @@ 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); }); @@ -631,11 +636,12 @@ 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); }); @@ -645,7 +651,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; @@ -653,7 +659,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); @@ -661,7 +667,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); }); @@ -674,24 +680,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 @@ -701,22 +707,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 ); }); @@ -729,13 +735,14 @@ 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); }); @@ -743,15 +750,16 @@ 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); }); @@ -785,9 +793,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 @@ -805,9 +813,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 1ad3cf40cdab..c421c4f0cb91 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,8 +267,9 @@ 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); }); @@ -292,7 +293,7 @@ describe("Core/EllipsoidTangentPlane", function () { const result = [index0]; const returnedResults = tangentPlane.projectPointsToNearestOnPlane( positions, - result, + result ); expect(result).toBe(returnedResults); expect(result[0]).toBe(index0); @@ -320,7 +321,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); @@ -330,7 +331,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); @@ -340,7 +341,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); @@ -350,7 +351,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); @@ -360,7 +361,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); @@ -369,12 +370,21 @@ 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 04fb3e6a5005..f3ed58d94a70 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 1753aca0e7bc..154d4c502b55 100644 --- a/packages/engine/Specs/Core/EllipsoidalOccluderSpec.js +++ b/packages/engine/Specs/Core/EllipsoidalOccluderSpec.js @@ -53,41 +53,39 @@ 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); }); @@ -106,7 +104,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); @@ -154,7 +152,7 @@ describe("Core/EllipsoidalOccluder", function () { expect(function () { ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -167,7 +165,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions, + positions ); expect(result.x).toEqualEpsilon(1.0, CesiumMath.EPSILON14); @@ -183,7 +181,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions, + positions ); expect(result).toBeUndefined(); }); @@ -196,7 +194,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions, + positions ); expect(result).toBeUndefined(); }); @@ -212,7 +210,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions, + positions ); expect(result).toBeUndefined(); }); @@ -225,7 +223,7 @@ describe("Core/EllipsoidalOccluder", function () { const result = ellipsoidalOccluder.computeHorizonCullingPoint( directionToPoint, - positions, + positions ); expect(result).toBeUndefined(); }); @@ -243,28 +241,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 ); }); @@ -281,12 +279,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 @@ -295,11 +293,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) { @@ -318,12 +316,11 @@ 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); @@ -358,14 +355,14 @@ describe("Core/EllipsoidalOccluder", function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( boundingSphere.center, vertices, - 7, + 7 ); expect(function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( undefined, vertices, - 7, + 7 ); }).toThrowDeveloperError(); @@ -373,7 +370,7 @@ describe("Core/EllipsoidalOccluder", function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( boundingSphere.center, undefined, - 7, + 7 ); }).toThrowDeveloperError(); @@ -381,7 +378,7 @@ describe("Core/EllipsoidalOccluder", function () { ellipsoidalOccluder.computeHorizonCullingPointFromVertices( boundingSphere.center, vertices, - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -413,15 +410,14 @@ describe("Core/EllipsoidalOccluder", function () { const result1 = ellipsoidalOccluder.computeHorizonCullingPoint( boundingSphere.center, - positions, + positions + ); + const result2 = ellipsoidalOccluder.computeHorizonCullingPointFromVertices( + boundingSphere.center, + vertices, + 7, + center ); - 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); @@ -435,14 +431,13 @@ 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); @@ -455,11 +450,10 @@ 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(); }); @@ -468,16 +462,15 @@ 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 @@ -493,11 +486,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 d78acddf983b..203e96725868 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 f6d8fffbd26e..a4a45dd49d03 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,12 +91,11 @@ 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(".")}` ); } }); @@ -132,8 +131,7 @@ 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(); @@ -165,7 +163,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 ca897c753485..24af379c2583 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,8 +89,27 @@ 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 aaffd5196156..e5435ea98dd7 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 f3ddd8945bdf..4f6c48700ec5 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 33826e1fbd8e..19f890867cb4 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 612605618646..e08cc000e89b 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,23 +136,24 @@ 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 ); }); @@ -162,24 +163,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 ); }); }); @@ -205,18 +206,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)); }); @@ -225,7 +226,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) ); }); @@ -234,7 +235,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) ); }); @@ -243,13 +244,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 d51bb6e4c848..b13cd183c74e 100644 --- a/packages/engine/Specs/Core/GeometryAttributeSpec.js +++ b/packages/engine/Specs/Core/GeometryAttributeSpec.js @@ -13,7 +13,18 @@ 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, ]); }); @@ -22,7 +33,18 @@ 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(); @@ -33,7 +55,18 @@ 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(); @@ -45,7 +78,18 @@ 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 7efb5bd1da72..a6ea60e5be1d 100644 --- a/packages/engine/Specs/Core/GeometryInstanceSpec.js +++ b/packages/engine/Specs/Core/GeometryInstanceSpec.js @@ -18,7 +18,15 @@ 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, ]), }), }, @@ -29,7 +37,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 3d1843964c56..4cba2dd3c472 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,11 +148,27 @@ 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(); @@ -161,7 +177,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 ); }); @@ -244,8 +260,24 @@ 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, ], }), }, @@ -307,8 +339,24 @@ 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, ], }), }, @@ -418,7 +466,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]); @@ -458,7 +506,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) @@ -497,7 +545,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 @@ -532,7 +580,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 @@ -603,16 +651,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); @@ -648,7 +696,7 @@ describe("Core/GeometryPipeline", function () { }), }, primitiveType: PrimitiveType.POINTS, - }), + }) ); }).toThrowDeveloperError(); }); @@ -666,7 +714,7 @@ describe("Core/GeometryPipeline", function () { }, primitiveType: PrimitiveType.POINTS, }), - "position", + "position" ); }).toThrowDeveloperError(); }); @@ -685,7 +733,7 @@ describe("Core/GeometryPipeline", function () { primitiveType: PrimitiveType.POINTS, }), "position", - "position3D", + "position3D" ); }).toThrowDeveloperError(); }); @@ -705,7 +753,7 @@ describe("Core/GeometryPipeline", function () { }), "position", "position3D", - "position2D", + "position2D" ); }).toThrowDeveloperError(); }); @@ -725,7 +773,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "position3D", - "position2D", + "position2D" ); }).toThrowDeveloperError(); }); @@ -744,7 +792,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "position3D", - "position2D", + "position2D" ); }).toThrowDeveloperError(); }); @@ -767,7 +815,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "positionHigh", - "positionLow", + "positionLow" ); expect(geometry.attributes.positionHigh).toBeDefined(); @@ -799,7 +847,7 @@ describe("Core/GeometryPipeline", function () { }), }, primitiveType: PrimitiveType.POINTS, - }), + }) ); }).toThrowDeveloperError(); }); @@ -817,7 +865,7 @@ describe("Core/GeometryPipeline", function () { }, primitiveType: PrimitiveType.POINTS, }), - "position", + "position" ); }).toThrowDeveloperError(); }); @@ -836,7 +884,7 @@ describe("Core/GeometryPipeline", function () { primitiveType: PrimitiveType.POINTS, }), "position", - "positionHigh", + "positionHigh" ); }).toThrowDeveloperError(); }); @@ -856,7 +904,7 @@ describe("Core/GeometryPipeline", function () { }), "position", "positionHigh", - "positionLow", + "positionLow" ); }).toThrowDeveloperError(); }); @@ -876,7 +924,7 @@ describe("Core/GeometryPipeline", function () { geometry, "position", "positionHigh", - "positionLow", + "positionLow" ); }).toThrowDeveloperError(); }); @@ -916,7 +964,7 @@ describe("Core/GeometryPipeline", function () { 0.0, 0.0, 0.0, - 1.0, + 1.0 ), }); @@ -925,13 +973,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); }); @@ -963,13 +1011,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); }); @@ -1001,13 +1049,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); }); @@ -1076,7 +1124,7 @@ describe("Core/GeometryPipeline", function () { }), }, primitiveType: PrimitiveType.POINTS, - }), + }) ); }); @@ -1124,14 +1172,30 @@ 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, - }), + }) ); }); @@ -1142,23 +1206,37 @@ 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, - }), + }) ), }), ]; @@ -1203,7 +1281,7 @@ describe("Core/GeometryPipeline", function () { ])[0]; const expected = BoundingSphere.union( instance.geometry.boundingSphere, - anotherInstance.geometry.boundingSphere, + anotherInstance.geometry.boundingSphere ); expect(combined.boundingSphere).toEqual(expected); }); @@ -1405,7 +1483,15 @@ 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, ]); }); @@ -1431,21 +1517,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 ); }); @@ -1454,7 +1540,27 @@ 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, @@ -1472,40 +1578,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 ); }); @@ -1550,15 +1656,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 ); }); @@ -1742,10 +1848,26 @@ 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, ]); }); @@ -1771,17 +1893,37 @@ 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 ); }); @@ -1795,7 +1937,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; @@ -1806,7 +1948,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; @@ -1839,7 +1981,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); @@ -1855,7 +1997,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(); @@ -1869,10 +2011,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 ); } }); @@ -1886,7 +2028,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(); @@ -1906,7 +2048,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 ); } }); @@ -1921,7 +2063,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(); @@ -1941,17 +2083,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 ); } }); @@ -1967,7 +2109,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(); @@ -1993,21 +2135,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 ); } }); @@ -2017,11 +2159,18 @@ 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, - }), + }) ), }); @@ -2111,14 +2260,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; @@ -2126,7 +2275,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 ); } @@ -2149,14 +2298,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; @@ -2164,7 +2313,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 ); } }); @@ -2177,8 +2326,24 @@ 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, ]), }), }, @@ -2198,8 +2363,24 @@ 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, ]), }), }, @@ -2239,8 +2420,23 @@ 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, ]), }), }, @@ -2261,7 +2457,18 @@ 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, ]), }), }, @@ -2301,8 +2508,24 @@ 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, ]), }), }, @@ -2313,7 +2536,18 @@ 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, ]); }); @@ -2344,7 +2578,18 @@ 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, ]), }), }, @@ -2364,7 +2609,18 @@ 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, ]), }), }, @@ -2404,7 +2660,15 @@ 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, ]), }), }, @@ -2425,7 +2689,18 @@ 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, ]), }), }, @@ -2465,7 +2740,18 @@ 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, ]), }), }, @@ -2505,7 +2791,15 @@ 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, ]), }), }, @@ -2521,7 +2815,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(); @@ -2529,7 +2823,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); }); @@ -2541,7 +2835,15 @@ 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, ]), }), }, @@ -2557,7 +2859,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(); @@ -2565,7 +2867,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); }); @@ -2577,7 +2879,15 @@ 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, ]), }), }, @@ -2593,7 +2903,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(); @@ -2601,7 +2911,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); }); @@ -2613,7 +2923,15 @@ 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, ]), }), }, @@ -2629,7 +2947,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(); @@ -2637,7 +2955,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); }); @@ -2649,7 +2967,15 @@ 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, ]), }), }, @@ -2665,7 +2991,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(); @@ -2673,7 +2999,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); }); @@ -2685,7 +3011,15 @@ 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, ]), }), }, @@ -2701,7 +3035,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(); @@ -2709,7 +3043,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); }); @@ -2765,7 +3099,15 @@ 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, ]), }), }, @@ -2780,7 +3122,15 @@ 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); }); @@ -2793,7 +3143,15 @@ 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, ]), }), }, @@ -2819,7 +3177,15 @@ 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, ]), }), }, @@ -2845,28 +3211,60 @@ 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({ @@ -2887,23 +3285,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(); @@ -2911,23 +3309,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 ); }); @@ -2953,7 +3351,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(); @@ -2961,7 +3359,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); }); @@ -3042,7 +3440,17 @@ 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, ]), }), @@ -3050,14 +3458,35 @@ 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, ]), }), @@ -3065,7 +3494,14 @@ 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, ]), }), }, @@ -3082,25 +3518,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(); @@ -3108,25 +3544,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); }); @@ -3138,21 +3574,53 @@ 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, ]), }), @@ -3160,7 +3628,14 @@ 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, ]), }), }, @@ -3207,7 +3682,18 @@ 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, ]); }); @@ -3219,7 +3705,17 @@ 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, ]), }), @@ -3227,7 +3723,17 @@ 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, ]), }), @@ -3235,7 +3741,17 @@ 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, ]), }), @@ -3243,7 +3759,14 @@ 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, ]), }), }, @@ -3290,7 +3813,18 @@ 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, ]); }); @@ -3302,14 +3836,35 @@ 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, ]), }), @@ -3317,14 +3872,32 @@ 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, ]), }), }, @@ -3371,7 +3944,18 @@ 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, ]); }); @@ -3383,7 +3967,17 @@ 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, ]), }), @@ -3391,14 +3985,35 @@ 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, ]), }), @@ -3406,7 +4021,14 @@ 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, ]), }), }, @@ -3453,7 +4075,18 @@ 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, ]); }); @@ -3465,21 +4098,53 @@ 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, ]), }), @@ -3487,7 +4152,14 @@ 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, ]), }), }, @@ -3503,7 +4175,18 @@ 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 2388cf5fb021..c07668cb52ea 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,40 +117,50 @@ 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 ba106dde17b9..c0b0996b981b 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,41 +113,42 @@ 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; @@ -161,34 +162,32 @@ 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); @@ -216,34 +215,32 @@ 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); @@ -267,10 +264,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 6835b4ca3030..25bc601ff706 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 57ccdbf5ae7a..8927fca15e42 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,8 +47,9 @@ 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 () { @@ -77,14 +78,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"); }); @@ -95,10 +96,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" ); }); @@ -106,8 +107,9 @@ 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); }); @@ -121,7 +123,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { metadata, { ellipsoid: ellipsoid, - }, + } ); expect(terrainProvider.tilingScheme.ellipsoid).toEqual(ellipsoid); @@ -131,8 +133,9 @@ 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); }); @@ -141,19 +144,20 @@ 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 ); }); @@ -161,8 +165,9 @@ 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(); }); @@ -175,7 +180,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { metadata, { credit: "thanks to our awesome made up contributors!", - }, + } ); expect(terrainProvider.credit).toBeDefined(); @@ -185,8 +190,9 @@ 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); }); @@ -195,8 +201,9 @@ 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); }); @@ -211,7 +218,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterprise/gee.terrain", @@ -219,7 +226,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { method, data, headers, - deferred, + deferred ); }; @@ -237,7 +244,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( "Data/GoogleEarthEnterprise/gee.terrain", @@ -245,14 +252,16 @@ 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); @@ -276,7 +285,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. @@ -290,7 +299,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { method, data, headers, - deferred, + deferred ); } // Do nothing, so requests never complete @@ -298,8 +307,9 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { }; const metadata = await GoogleEarthEnterpriseMetadata.fromUrl(baseUrl); - terrainProvider = - GoogleEarthEnterpriseTerrainProvider.fromMetadata(metadata); + terrainProvider = GoogleEarthEnterpriseTerrainProvider.fromMetadata( + metadata + ); const promises = []; return pollToPromise(function () { @@ -356,7 +366,7 @@ describe("Core/GoogleEarthEnterpriseTerrainProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( "Data/CesiumTerrainTileJson/tile.terrain", @@ -364,13 +374,14 @@ 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 6a6f842b7623..84af45fa9cb9 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,13 +350,18 @@ 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); @@ -368,37 +373,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); }); @@ -416,7 +421,7 @@ describe("Core/GroundPolylineGeometry", function () { }); let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry, + groundPolylineGeometry ); let startNormalAndForwardOffsetZvalues = @@ -426,33 +431,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 @@ -479,33 +484,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); }); @@ -516,7 +521,7 @@ describe("Core/GroundPolylineGeometry", function () { }); let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry, + groundPolylineGeometry ); expect(geometry.indices.length).toEqual(72); @@ -525,7 +530,12 @@ 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, }); @@ -552,10 +562,10 @@ describe("Core/GroundPolylineGeometry", function () { }); let rhumbGeometry = GroundPolylineGeometry.createGeometry( - rhumbGroundPolylineGeometry, + rhumbGroundPolylineGeometry ); let geodesicGeometry = GroundPolylineGeometry.createGeometry( - geodesicGroundPolylineGeometry, + geodesicGroundPolylineGeometry ); expect(rhumbGeometry.indices.length).toEqual(3636); @@ -577,16 +587,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); }); @@ -600,13 +610,18 @@ 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, @@ -625,7 +640,7 @@ describe("Core/GroundPolylineGeometry", function () { }); let geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry, + groundPolylineGeometry ); expect(geometry.indices.length).toEqual(72); @@ -645,7 +660,14 @@ 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, @@ -687,7 +709,7 @@ describe("Core/GroundPolylineGeometry", function () { groundPolylineGeometry._scene3DOnly = true; GroundPolylineGeometry.setProjectionAndEllipsoid( groundPolylineGeometry, - new WebMercatorProjection(Ellipsoid.UNIT_SPHERE), + new WebMercatorProjection(Ellipsoid.UNIT_SPHERE) ); const packedArray = [0]; @@ -702,14 +724,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); @@ -727,7 +749,7 @@ describe("Core/GroundPolylineGeometry", function () { groundPolylineGeometry._scene3DOnly = true; GroundPolylineGeometry.setProjectionAndEllipsoid( groundPolylineGeometry, - new WebMercatorProjection(Ellipsoid.UNIT_SPHERE), + new WebMercatorProjection(Ellipsoid.UNIT_SPHERE) ); const packedArray = [0]; @@ -739,14 +761,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); @@ -764,17 +786,22 @@ 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, @@ -786,12 +813,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(); @@ -800,20 +827,22 @@ 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, ]); @@ -824,7 +853,7 @@ describe("Core/GroundPolylineGeometry", function () { }); const geometry = GroundPolylineGeometry.createGeometry( - groundPolylineGeometry, + groundPolylineGeometry ); const boundingSphere = geometry.boundingSphere; @@ -836,7 +865,10 @@ 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 @@ -847,7 +879,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 e753e75cc7b4..a65df32d5633 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 a2a480c9c745..0e5cf83af3c9 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 57d0c557da02..ea0b8657bf03 100644 --- a/packages/engine/Specs/Core/HeightmapTerrainDataSpec.js +++ b/packages/engine/Specs/Core/HeightmapTerrainDataSpec.js @@ -230,8 +230,22 @@ 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, @@ -247,8 +261,22 @@ 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, ]); }); }); @@ -256,9 +284,54 @@ 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, @@ -278,9 +351,54 @@ 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, ]); }); }); @@ -288,9 +406,54 @@ 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, @@ -311,9 +474,54 @@ 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, ]); }); }); @@ -321,8 +529,22 @@ 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, @@ -338,8 +560,22 @@ 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, ]); }); }); @@ -347,9 +583,54 @@ 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, @@ -369,9 +650,54 @@ 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, ]); }); }); @@ -379,8 +705,22 @@ 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, @@ -402,7 +742,22 @@ 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 240888f62a30..b8a908263921 100644 --- a/packages/engine/Specs/Core/HermitePolynomialApproximationSpec.js +++ b/packages/engine/Specs/Core/HermitePolynomialApproximationSpec.js @@ -6,14 +6,40 @@ 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); @@ -33,7 +59,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 @@ -48,7 +74,7 @@ describe("Core/HermitePolynomialApproximation", function () { xTable, yTableCombined, 4, - result, + result ); const expectedResult = 13367002.870928625; expect(result).toBe(returnedResult); @@ -62,13 +88,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 ); }); @@ -79,7 +105,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 d66356a7aa9e..3b04ea682381 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 86e48b9a1d6b..059ac4aef448 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 77c553f27741..8d220d4f1a1c 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 7091e8529e4a..a3a8132643bc 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 6e6d8ef2a0f9..8b1a1eb776f3 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 fd922961eac1..cfa2819c2534 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,174 +462,162 @@ 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 17951c615c02..43b490eab0a1 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 fe073840afc5..754bbbb030c9 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 9bc22b32d88e..4a034a293659 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 cfeda6cf173b..d7771e80cc5b 100644 --- a/packages/engine/Specs/Core/LagrangePolynomialApproximationSpec.js +++ b/packages/engine/Specs/Core/LagrangePolynomialApproximationSpec.js @@ -6,10 +6,30 @@ 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; @@ -19,7 +39,7 @@ describe("Core/LagrangePolynomialApproximation", function () { x, xTable, yTable, - 3, + 3 ); const expectedResult = [13367002.870928623, 545695.7388100647, 0]; expect(result).toEqualEpsilon(expectedResult, 1e-15); @@ -32,7 +52,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 cc5be320b17e..d64c9de42620 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 c81a4a5ed935..b6f66748ffa6 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 98af0d7c8ecf..5d4f5ac965bd 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,10 +472,29 @@ 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 @@ -704,20 +723,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 ); }); @@ -760,30 +779,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 bfbab21851fb..540b550d0c20 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 3d2f4641aeb7..e0ada12c1755 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,7 +289,15 @@ 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); }); @@ -300,7 +308,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); @@ -312,7 +320,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); @@ -321,7 +329,15 @@ 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); }); @@ -331,7 +347,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); @@ -340,7 +356,15 @@ 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); }); @@ -350,7 +374,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); @@ -414,7 +438,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); @@ -425,7 +449,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); @@ -473,7 +497,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); @@ -483,7 +507,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); @@ -493,7 +517,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); @@ -529,7 +553,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); @@ -539,7 +563,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); @@ -549,7 +573,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); @@ -567,7 +591,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); }); @@ -584,7 +608,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); }); @@ -602,7 +626,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 ); }); @@ -621,7 +645,15 @@ 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), @@ -640,7 +672,15 @@ 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([ @@ -723,7 +763,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); @@ -737,7 +777,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); @@ -750,7 +790,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); @@ -764,7 +804,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); @@ -802,7 +842,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); @@ -821,7 +861,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); @@ -842,7 +882,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); @@ -874,7 +914,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); @@ -893,7 +933,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); @@ -912,44 +952,41 @@ 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 ); }); @@ -965,7 +1002,7 @@ describe("Core/Matrix3", function () { 0.0, 0.0, 0.0, - 1.0, + 1.0 ); const result = { unitary: new Matrix3(), @@ -976,38 +1013,35 @@ 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 ); }); @@ -1021,7 +1055,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(); @@ -1047,7 +1081,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); @@ -1451,7 +1485,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 375416d0a849..ae2c6fa15a81 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,11 +87,25 @@ 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); }); @@ -113,16 +127,30 @@ 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); @@ -145,16 +173,33 @@ 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); @@ -177,11 +222,25 @@ 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); }); @@ -203,15 +262,29 @@ 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); @@ -234,11 +307,25 @@ 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); }); @@ -260,15 +347,29 @@ 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); @@ -291,7 +392,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const returnedResult = expected.clone(); expect(returnedResult).not.toBe(expected); @@ -315,7 +416,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const result = new Matrix4(); const returnedResult = expected.clone(result); @@ -341,11 +442,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); @@ -368,13 +469,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); @@ -398,10 +499,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); @@ -424,12 +525,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); @@ -452,14 +553,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); @@ -483,13 +584,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); @@ -514,13 +615,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(); @@ -547,12 +648,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); @@ -576,7 +677,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); @@ -600,12 +701,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); @@ -629,7 +730,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); @@ -652,7 +753,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); @@ -662,29 +763,73 @@ 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); @@ -707,7 +852,7 @@ describe("Core/Matrix4", function () { 0, 0, -1, - 0, + 0 ); const result = new Matrix4(); const returnedResult = Matrix4.computePerspectiveFieldOfView( @@ -715,7 +860,7 @@ describe("Core/Matrix4", function () { 1, 1, 10, - result, + result ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON15); }); @@ -739,7 +884,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); @@ -762,7 +907,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const result = new Matrix4(); const returnedResult = Matrix4.computeOrthographicOffCenter( @@ -772,7 +917,7 @@ describe("Core/Matrix4", function () { 3, 0, 1, - result, + result ); expect(returnedResult).toBe(result); expect(returnedResult).toEqual(expected); @@ -795,7 +940,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0, + 1.0 ); const returnedResult = Matrix4.computeViewportTransformation( { @@ -805,7 +950,7 @@ describe("Core/Matrix4", function () { height: 6.0, }, 0.0, - 2.0, + 2.0 ); expect(returnedResult).toEqual(expected); }); @@ -827,7 +972,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0, + 1.0 ); const result = new Matrix4(); const returnedResult = Matrix4.computeViewportTransformation( @@ -839,7 +984,7 @@ describe("Core/Matrix4", function () { }, 0.0, 2.0, - result, + result ); expect(returnedResult).toEqual(expected); expect(returnedResult).toBe(result); @@ -862,7 +1007,7 @@ describe("Core/Matrix4", function () { 0, 0, -1, - 0, + 0 ); const result = new Matrix4(); const returnedResult = Matrix4.computePerspectiveOffCenter( @@ -872,7 +1017,7 @@ describe("Core/Matrix4", function () { 3, 1, 2, - result, + result ); expect(returnedResult).toEqual(expected); expect(returnedResult).toBe(result); @@ -895,7 +1040,7 @@ describe("Core/Matrix4", function () { 0, 0, -1, - 0, + 0 ); const result = new Matrix4(); const returnedResult = Matrix4.computeInfinitePerspectiveOffCenter( @@ -904,18 +1049,32 @@ 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); @@ -923,13 +1082,27 @@ 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); @@ -964,7 +1137,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); @@ -1007,7 +1180,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const result = new Matrix4(); @@ -1028,13 +1201,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); @@ -1055,13 +1228,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); @@ -1082,13 +1255,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); @@ -1109,13 +1282,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); @@ -1138,7 +1311,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(); @@ -1159,7 +1332,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); @@ -1183,7 +1356,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); @@ -1226,7 +1399,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const result = new Matrix4(); @@ -1246,13 +1419,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); @@ -1273,13 +1446,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); @@ -1300,13 +1473,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); @@ -1327,13 +1500,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); @@ -1351,7 +1524,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); }); @@ -1368,7 +1541,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); }); @@ -1386,7 +1559,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 ); }); @@ -1406,8 +1579,16 @@ 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), @@ -1427,8 +1608,16 @@ 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([ @@ -1465,7 +1654,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = new Matrix4( 17, @@ -1483,7 +1672,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32, + 32 ); const expected = new Matrix4( 250, @@ -1501,7 +1690,7 @@ describe("Core/Matrix4", function () { 1354, 1412, 1470, - 1528, + 1528 ); const result = new Matrix4(); const returnedResult = Matrix4.multiply(left, right, result); @@ -1526,7 +1715,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = new Matrix4( 17, @@ -1544,7 +1733,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32, + 32 ); const expected = new Matrix4( 250, @@ -1562,7 +1751,7 @@ describe("Core/Matrix4", function () { 1354, 1412, 1470, - 1528, + 1528 ); const returnedResult = Matrix4.multiply(left, right, left); expect(returnedResult).toBe(left); @@ -1586,7 +1775,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = new Matrix4( 17, @@ -1604,7 +1793,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32, + 32 ); const expected = new Matrix4( 18, @@ -1622,7 +1811,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48, + 48 ); const result = new Matrix4(); const returnedResult = Matrix4.add(left, right, result); @@ -1647,7 +1836,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = new Matrix4( 17, @@ -1665,7 +1854,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32, + 32 ); const expected = new Matrix4( 18, @@ -1683,7 +1872,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48, + 48 ); const returnedResult = Matrix4.add(left, right, left); expect(returnedResult).toBe(left); @@ -1707,7 +1896,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48, + 48 ); const right = new Matrix4( 17, @@ -1725,7 +1914,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32, + 32 ); const expected = new Matrix4( 1, @@ -1743,7 +1932,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const result = new Matrix4(); const returnedResult = Matrix4.subtract(left, right, result); @@ -1768,7 +1957,7 @@ describe("Core/Matrix4", function () { 42, 44, 46, - 48, + 48 ); const right = new Matrix4( 17, @@ -1786,7 +1975,7 @@ describe("Core/Matrix4", function () { 29, 30, 31, - 32, + 32 ); const expected = new Matrix4( 1, @@ -1804,7 +1993,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const returnedResult = Matrix4.subtract(left, right, left); expect(returnedResult).toBe(left); @@ -1829,7 +2018,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const expected = new Matrix4( 134, @@ -1847,7 +2036,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const result = new Matrix4(); const returnedResult = Matrix4.multiplyTransformation(left, right, result); @@ -1873,7 +2062,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const expected = new Matrix4( 134, @@ -1891,7 +2080,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const returnedResult = Matrix4.multiplyTransformation(left, right, left); expect(returnedResult).toBe(left); @@ -1901,20 +2090,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); @@ -1923,14 +2112,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); @@ -1943,13 +2132,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); @@ -1961,7 +2150,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); @@ -1970,7 +2159,22 @@ 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([ @@ -1999,7 +2203,22 @@ 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([ @@ -2049,7 +2268,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); @@ -2058,7 +2277,22 @@ 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([ @@ -2088,7 +2322,22 @@ 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([ @@ -2132,7 +2381,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); @@ -2159,7 +2408,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = new Cartesian3(17, 18, 19); const expected = new Cartesian3(114, 334, 554); @@ -2186,7 +2435,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = new Cartesian3(17, 18, 19); const expected = new Cartesian3(110, 326, 542); @@ -2213,7 +2462,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const right = 2; const expected = new Matrix4( @@ -2232,7 +2481,7 @@ describe("Core/Matrix4", function () { 26, 28, 30, - 32, + 32 ); const result = new Matrix4(); const returnedResult = Matrix4.multiplyByScalar(left, right, result); @@ -2257,7 +2506,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const expected = new Matrix4( -1.0, @@ -2275,7 +2524,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); @@ -2300,7 +2549,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const expected = new Matrix4( -1.0, @@ -2318,7 +2567,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); @@ -2342,7 +2591,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const expected = new Matrix4( 1.0, @@ -2360,7 +2609,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); @@ -2385,12 +2634,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); @@ -2413,7 +2662,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); const expected = new Matrix4( 1.0, @@ -2431,7 +2680,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); @@ -2455,7 +2704,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); let right = new Matrix4( 1.0, @@ -2473,7 +2722,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); expect(Matrix4.equals(left, right)).toEqual(true); @@ -2493,7 +2742,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); @@ -2514,7 +2763,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); @@ -2535,7 +2784,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); @@ -2556,7 +2805,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); @@ -2577,7 +2826,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); @@ -2598,7 +2847,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); @@ -2619,7 +2868,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); @@ -2640,7 +2889,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); @@ -2661,7 +2910,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); @@ -2690,7 +2939,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); let right = new Matrix4( 1.0, @@ -2708,7 +2957,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); expect(Matrix4.equalsEpsilon(left, right, 1.0)).toEqual(true); @@ -2728,7 +2977,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 5.0, @@ -2746,7 +2995,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); @@ -2767,7 +3016,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -2785,7 +3034,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); @@ -2806,7 +3055,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -2824,7 +3073,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); @@ -2845,7 +3094,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -2863,7 +3112,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); @@ -2884,7 +3133,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -2902,7 +3151,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); @@ -2923,7 +3172,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -2941,7 +3190,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); @@ -2962,7 +3211,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -2980,7 +3229,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); @@ -3001,7 +3250,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3019,7 +3268,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); @@ -3040,7 +3289,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3058,7 +3307,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); @@ -3079,7 +3328,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3097,7 +3346,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); @@ -3118,7 +3367,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3136,7 +3385,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); @@ -3157,7 +3406,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3175,7 +3424,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); @@ -3196,7 +3445,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3214,7 +3463,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); @@ -3235,7 +3484,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3253,7 +3502,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); @@ -3274,7 +3523,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3292,7 +3541,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); @@ -3313,7 +3562,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); right = new Matrix4( 1.0, @@ -3331,7 +3580,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); @@ -3360,10 +3609,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)" ); }); @@ -3384,7 +3633,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); const expected = new Cartesian3(4, 8, 12); const result = new Cartesian3(); @@ -3410,7 +3659,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(); @@ -3436,7 +3685,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0, + 1.0 ); const expected = new Matrix4( @@ -3455,7 +3704,7 @@ describe("Core/Matrix4", function () { 0.0, 0.0, 0.0, - 1.0, + 1.0 ); const result = new Matrix4(); @@ -3463,7 +3712,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); }); @@ -3481,7 +3730,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); @@ -3502,7 +3751,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const result = Matrix4.inverse(matrix, new Matrix4()); @@ -3513,7 +3762,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); @@ -3534,7 +3783,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const result = Matrix4.inverse(matrix, new Matrix4()); @@ -3558,7 +3807,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const expected = new Matrix4( @@ -3577,7 +3826,7 @@ describe("Core/Matrix4", function () { 0, 0, 0, - 1, + 1 ); const result = new Matrix4(); @@ -3585,7 +3834,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 ); }); @@ -3612,7 +3861,7 @@ describe("Core/Matrix4", function () { -13.0, -14.0, -15.0, - -16.0, + -16.0 ); const expected = new Matrix4( 1.0, @@ -3630,7 +3879,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); @@ -3652,7 +3901,7 @@ describe("Core/Matrix4", function () { 13.0, 14.0, 15.0, - 16.0, + 16.0 ); returnedResult = Matrix4.abs(matrix, result); expect(returnedResult).toEqual(expected); @@ -3673,7 +3922,7 @@ describe("Core/Matrix4", function () { 13.0, -14.0, 15.0, - -16.0, + -16.0 ); returnedResult = Matrix4.abs(matrix, result); expect(returnedResult).toEqual(expected); @@ -3696,7 +3945,7 @@ describe("Core/Matrix4", function () { -13.0, -14.0, -15.0, - -16.0, + -16.0 ); const expected = new Matrix4( 1.0, @@ -3714,7 +3963,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); @@ -3750,7 +3999,7 @@ describe("Core/Matrix4", function () { Matrix4.fromTranslationQuaternionRotationScale( undefined, new Quaternion(), - new Cartesian3(), + new Cartesian3() ); }).toThrowDeveloperError(); }); @@ -3760,7 +4009,7 @@ describe("Core/Matrix4", function () { Matrix4.fromTranslationQuaternionRotationScale( new Matrix3(), undefined, - new Cartesian3(), + new Cartesian3() ); }).toThrowDeveloperError(); }); @@ -3770,7 +4019,7 @@ describe("Core/Matrix4", function () { Matrix4.fromTranslationQuaternionRotationScale( new Matrix3(), new Quaternion(), - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -3869,7 +4118,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -3887,7 +4136,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -3905,7 +4154,7 @@ describe("Core/Matrix4", function () { undefined, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -3923,7 +4172,7 @@ describe("Core/Matrix4", function () { bottom, undefined, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -3941,7 +4190,7 @@ describe("Core/Matrix4", function () { bottom, top, undefined, - far, + far ); }).toThrowDeveloperError(); }); @@ -3959,7 +4208,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -3977,7 +4226,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -3995,7 +4244,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4013,7 +4262,7 @@ describe("Core/Matrix4", function () { undefined, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4031,7 +4280,7 @@ describe("Core/Matrix4", function () { bottom, undefined, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4049,7 +4298,7 @@ describe("Core/Matrix4", function () { bottom, top, undefined, - far, + far ); }).toThrowDeveloperError(); }); @@ -4067,7 +4316,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -4085,7 +4334,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4103,7 +4352,7 @@ describe("Core/Matrix4", function () { bottom, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4121,7 +4370,7 @@ describe("Core/Matrix4", function () { undefined, top, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4139,7 +4388,7 @@ describe("Core/Matrix4", function () { bottom, undefined, near, - far, + far ); }).toThrowDeveloperError(); }); @@ -4157,7 +4406,7 @@ describe("Core/Matrix4", function () { bottom, top, undefined, - far, + far ); }).toThrowDeveloperError(); }); @@ -4507,7 +4756,7 @@ describe("Core/Matrix4", function () { 13, 14, 15, - 16, + 16 ); expect(function () { Matrix4.inverse(matrix, new Matrix4()); @@ -4754,7 +5003,7 @@ describe("Core/Matrix4", function () { right, bottom, top, - near, + near ); }).toThrowDeveloperError(); }); @@ -4786,7 +5035,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 1e133af23edb..3350cddc431b 100644 --- a/packages/engine/Specs/Core/NearFarScalarSpec.js +++ b/packages/engine/Specs/Core/NearFarScalarSpec.js @@ -40,9 +40,10 @@ 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 ccb915e2470c..d4e18ff9b12e 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 a3a06264cccf..50ab76102342 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 3bd41233c5fd..a424c6561c35 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 cb9deacbb96e..fa90747bbd10 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 90c8153a5ab4..4040ffc5df38 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 1211b0b1353a..a12b2cc1899e 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 7fd5d508e69f..3e3c16fdcf1a 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 4e443c690d0e..3d4201bff5ca 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 8b8cd0342878..5e863733d0d8 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 76f67c0878a2..f943dbcbb04a 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 a8a3141035d9..386a4b31dd61 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 bc780ff32050..ba566d5f7f75 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 d91f7c2f9d93..cd41d22d07b0 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 9abbd6d5d6f8..f82851fc9bcf 100644 --- a/packages/engine/Specs/Core/PolygonGeometryLibrarySpec.js +++ b/packages/engine/Specs/Core/PolygonGeometryLibrarySpec.js @@ -10,61 +10,78 @@ 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); @@ -76,14 +93,24 @@ 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); @@ -95,14 +122,24 @@ 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); @@ -114,208 +151,240 @@ 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]); @@ -323,44 +392,56 @@ 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]); @@ -369,41 +450,56 @@ 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]); @@ -413,21 +509,36 @@ 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); @@ -435,7 +546,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); @@ -445,113 +556,140 @@ 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 e47cbd9605a2..14d51ec71915 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,14 +97,19 @@ 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(); }); @@ -112,19 +117,35 @@ 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(); }); @@ -132,12 +153,28 @@ 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, ]), }, ], @@ -147,7 +184,7 @@ describe("Core/PolygonGeometry", function () { new PolygonGeometry({ polygonHierarchy: hierarchy, perPositionHeight: true, - }), + }) ); expect(geometry).toBeDefined(); }); @@ -157,10 +194,17 @@ 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 @@ -188,18 +232,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); }); @@ -208,11 +252,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.RHUMB, - }), + }) ); expect(p.attributes.position.values.length).toEqual(15 * 3); // 8 around edge + 7 in the middle @@ -225,18 +276,32 @@ 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({ @@ -244,7 +309,7 @@ describe("Core/PolygonGeometry", function () { positions: positions, granularity: CesiumMath.RADIANS_PER_DEGREE, arcType: ArcType.GEODESIC, - }), + }) ); const rhumb = PolygonGeometry.createGeometry( PolygonGeometry.fromPositions({ @@ -252,11 +317,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); }); @@ -283,18 +348,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); }); @@ -303,9 +368,16 @@ 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; @@ -321,17 +393,38 @@ 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, ]), }, ], @@ -344,7 +437,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 @@ -354,17 +447,38 @@ 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, ]), }, ], @@ -378,7 +492,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 @@ -388,18 +502,43 @@ 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, ]), }, @@ -413,7 +552,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); @@ -423,17 +562,38 @@ 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, ]), }, ], @@ -446,7 +606,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); @@ -455,13 +615,34 @@ 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, @@ -482,26 +663,47 @@ 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); @@ -513,27 +715,41 @@ 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( @@ -541,7 +757,7 @@ describe("Core/PolygonGeometry", function () { vertexFormat: VertexFormat.POSITIONS_ONLY, positions: positions, height: height, - }), + }) ); const bs = BoundingSphere.fromPoints( @@ -558,7 +774,7 @@ describe("Core/PolygonGeometry", function () { -106.0, 1.0, height, - ]), + ]) ); expect(Math.abs(p.boundingSphere.radius - bs.radius)).toBeLessThan(100.0); }); @@ -568,10 +784,17 @@ 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 @@ -585,11 +808,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, ]), extrudedHeight: 30000, closeTop: false, - }), + }) ); const numVertices = 37; // 13 bottom + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -603,11 +833,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, ]), extrudedHeight: 30000, closeBottom: false, - }), + }) ); const numVertices = 37; // 13 top + 8 top edge + 8 bottom edge + 4 top corner + 4 bottom corner @@ -621,12 +858,19 @@ 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 @@ -640,11 +884,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, offsetAttribute: GeometryOffsetAttribute.TOP, - }), + }) ); const numVertices = 13; @@ -661,11 +912,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, ]), extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.TOP, - }), + }) ); const numVertices = 50; @@ -685,12 +943,19 @@ 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 @@ -707,12 +972,19 @@ 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; @@ -729,13 +1001,20 @@ 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; @@ -752,11 +1031,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, ]), extrudedHeight: 30000, offsetAttribute: GeometryOffsetAttribute.ALL, - }), + }) ); const numVertices = 50; @@ -773,12 +1059,19 @@ 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 @@ -795,12 +1088,19 @@ 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; @@ -817,13 +1117,20 @@ 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; @@ -840,10 +1147,19 @@ 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); @@ -855,11 +1171,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, ]), height: 0, extrudedHeight: CesiumMath.EPSILON7, - }), + }) ); expect(p.attributes.position.values.length).toEqual(13 * 3); @@ -872,11 +1195,18 @@ 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; @@ -895,12 +1225,19 @@ 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; @@ -916,12 +1253,22 @@ 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; @@ -945,13 +1292,20 @@ 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; @@ -964,17 +1318,38 @@ 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, ]), }, ], @@ -988,7 +1363,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 @@ -1014,24 +1389,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; @@ -1045,7 +1420,7 @@ describe("Core/PolygonGeometry", function () { !CesiumMath.equalsEpsilon( normals[i], expectedNormals[i], - CesiumMath.EPSILON6, + CesiumMath.EPSILON6 ) ) { notEqualCount++; @@ -1059,7 +1434,18 @@ 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({ @@ -1067,7 +1453,7 @@ describe("Core/PolygonGeometry", function () { extrudedHeight: 0, vertexFormat: VertexFormat.POSITION_ONLY, perPositionHeight: true, - }), + }) ); expect(geometry).toBeDefined(); expect(geometry.attributes.position).toBeDefined(); @@ -1076,9 +1462,15 @@ 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, ]); @@ -1090,7 +1482,7 @@ describe("Core/PolygonGeometry", function () { closeTop: false, closeBottom: false, arcType: ArcType.RHUMB, - }), + }) ); let numVertices = 20; @@ -1106,13 +1498,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); }); @@ -1122,7 +1514,17 @@ 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, ]), }, @@ -1134,15 +1536,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 ); }); @@ -1151,7 +1553,18 @@ 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, @@ -1162,22 +1575,33 @@ 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, @@ -1187,19 +1611,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 ); }); @@ -1208,7 +1632,14 @@ 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, @@ -1218,19 +1649,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 ); }); @@ -1258,19 +1689,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 ); }); @@ -1283,7 +1714,7 @@ describe("Core/PolygonGeometry", function () { positions, Ellipsoid.WGS84, ArcType.GEODESIC, - result, + result ); expect(returned).toBe(result); @@ -1294,21 +1725,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)); @@ -1320,340 +1751,411 @@ 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 ); }); }); @@ -1663,7 +2165,18 @@ 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, @@ -1676,34 +2189,45 @@ 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, @@ -1714,40 +2238,55 @@ 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, @@ -1794,7 +2333,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( @@ -1810,7 +2349,7 @@ describe("Core/PolygonGeometry", function () { -1, ArcType.GEODESIC, -1, - 55, + 55 ); createPackableSpecs(PolygonGeometry, polygon, packedInstance); @@ -1850,7 +2389,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( @@ -1864,7 +2403,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 a8e6ef401049..92838d833a14 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,14 +92,19 @@ 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(); }); @@ -107,19 +112,35 @@ 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(); }); @@ -127,12 +148,28 @@ 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, ]), }, ], @@ -142,7 +179,7 @@ describe("Core/PolygonOutlineGeometry", function () { new PolygonOutlineGeometry({ polygonHierarchy: hierarchy, perPositionHeight: true, - }), + }) ); expect(geometry).toBeDefined(); }); @@ -151,9 +188,16 @@ 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); @@ -181,18 +225,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); }); @@ -200,11 +244,18 @@ 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 @@ -216,36 +267,50 @@ 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); }); @@ -272,18 +337,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); }); @@ -311,40 +376,61 @@ 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, ]), }, ], @@ -356,7 +442,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 @@ -366,17 +452,38 @@ 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, ]), }, ], @@ -388,7 +495,7 @@ describe("Core/PolygonOutlineGeometry", function () { new PolygonOutlineGeometry({ polygonHierarchy: hierarchy, granularity: CesiumMath.PI_OVER_THREE, - }), + }) ); expect(p.attributes.position.values.length).toEqual(12 * 3); @@ -397,13 +504,34 @@ 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, @@ -423,26 +551,47 @@ 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 ); }); @@ -450,34 +599,48 @@ 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( @@ -494,7 +657,7 @@ describe("Core/PolygonOutlineGeometry", function () { -106.0, 1.0, height, - ]), + ]) ); expect(Math.abs(p.boundingSphere.radius - bs.radius)).toBeLessThan(100.0); }); @@ -503,10 +666,17 @@ 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 @@ -516,17 +686,38 @@ 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, ]), }, ], @@ -539,7 +730,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 @@ -550,10 +741,17 @@ 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; @@ -568,11 +766,18 @@ 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; @@ -588,11 +793,18 @@ 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; @@ -615,13 +827,28 @@ 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, @@ -656,7 +883,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, @@ -666,7 +893,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 9819f86e64c8..b39594523eca 100644 --- a/packages/engine/Specs/Core/PolygonPipelineSpec.js +++ b/packages/engine/Specs/Core/PolygonPipelineSpec.js @@ -131,7 +131,30 @@ 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, ]); }); @@ -159,8 +182,48 @@ 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, ]); }); }); @@ -204,7 +267,7 @@ describe("Core/PolygonPipeline", function () { [], [1, 2, 3], undefined, - -1.0, + -1.0 ); }).toThrowDeveloperError(); }); @@ -221,7 +284,7 @@ describe("Core/PolygonPipeline", function () { positions, indices, undefined, - 60.0, + 60.0 ); expect(subdivision.attributes.position.values[0]).toEqual(0.0); @@ -245,7 +308,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), @@ -255,54 +318,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); @@ -325,7 +388,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), @@ -343,54 +406,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); @@ -450,7 +513,7 @@ describe("Core/PolygonPipeline", function () { PolygonPipeline.computeRhumbLineSubdivision( Ellipsoid.WGS84, [], - [1, 2, 3, 4], + [1, 2, 3, 4] ); }).toThrowDeveloperError(); }); @@ -462,7 +525,7 @@ describe("Core/PolygonPipeline", function () { [], [1, 2, 3], undefined, - -1.0, + -1.0 ); }).toThrowDeveloperError(); }); @@ -475,7 +538,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); @@ -501,7 +564,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 @@ -516,7 +579,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 @@ -529,7 +592,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), @@ -547,56 +610,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 4cbbaac0309f..46f0bf04b4d1 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,14 +184,19 @@ 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({ @@ -199,7 +204,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.RHUMB, - }), + }) ); const attributePositions = geometry.attributes.position.values; @@ -210,8 +215,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[0], - CesiumMath.EPSILON7, - ), + CesiumMath.EPSILON7 + ) ).toBe(true); Cartesian3.fromArray(attributePositions, 3, geometryPosition); @@ -219,8 +224,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[0], - CesiumMath.EPSILON7, - ), + CesiumMath.EPSILON7 + ) ).toBe(true); Cartesian3.fromArray(attributePositions, 6, geometryPosition); @@ -228,8 +233,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[1], - CesiumMath.EPSILON7, - ), + CesiumMath.EPSILON7 + ) ).toBe(true); Cartesian3.fromArray(attributePositions, 9, geometryPosition); @@ -237,8 +242,8 @@ describe("Core/PolylineGeometry", function () { Cartesian3.equalsEpsilon( geometryPosition, positions[1], - CesiumMath.EPSILON7, - ), + CesiumMath.EPSILON7 + ) ).toBe(true); }); @@ -268,7 +273,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.NONE, - }), + }) ); const numVertices = expectedPositions.length * 4 - 4; @@ -280,7 +285,7 @@ describe("Core/PolylineGeometry", function () { function attributeArrayEqualsColorArray( attributeArray, colorArray, - colorsPerVertex, + colorsPerVertex ) { colorsPerVertex = defaultValue(colorsPerVertex, false); let i; @@ -361,7 +366,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.POSITION_ONLY, arcType: ArcType.NONE, - }), + }) ); const numVertices = expectedPositions.length * 4 - 4; @@ -369,8 +374,8 @@ describe("Core/PolylineGeometry", function () { expect( attributeArrayEqualsColorArray( line.attributes.color.values, - expectedColors, - ), + expectedColors + ) ).toBe(true); }); @@ -425,7 +430,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.DEFAULT, arcType: ArcType.NONE, - }), + }) ); const numVertices = expectedPositions.length * 4 - 4; @@ -434,8 +439,8 @@ describe("Core/PolylineGeometry", function () { attributeArrayEqualsColorArray( line.attributes.color.values, expectedColors, - true, - ), + true + ) ).toBe(true); }); @@ -474,7 +479,7 @@ describe("Core/PolylineGeometry", function () { width: 10.0, vertexFormat: VertexFormat.DEFAULT, arcType: ArcType.NONE, - }), + }) ); const numVertices = expectedPositions.length * 4 - 4; @@ -483,8 +488,8 @@ describe("Core/PolylineGeometry", function () { attributeArrayEqualsColorArray( line.attributes.color.values, expectedColors, - true, - ), + true + ) ).toBe(true); }); @@ -504,14 +509,48 @@ 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({ @@ -524,7 +563,30 @@ 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"); @@ -538,7 +600,30 @@ 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"); @@ -552,7 +637,30 @@ 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 25f3790aeaef..2c8d62b014e1 100644 --- a/packages/engine/Specs/Core/PolylinePipelineSpec.js +++ b/packages/engine/Specs/Core/PolylinePipelineSpec.js @@ -9,7 +9,10 @@ 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); @@ -61,7 +64,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 ); }); @@ -82,13 +85,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 ); }); @@ -128,7 +131,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 ); }); @@ -149,13 +152,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 4f3fdb5fd4e7..a78a3b3f02d3 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,11 +64,14 @@ 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 @@ -82,11 +85,14 @@ 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); @@ -98,11 +104,14 @@ 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; @@ -119,11 +128,14 @@ 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; @@ -141,11 +153,16 @@ 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 @@ -159,11 +176,16 @@ 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); @@ -175,11 +197,18 @@ 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 @@ -194,11 +223,18 @@ 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 @@ -213,14 +249,25 @@ 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 @@ -234,12 +281,17 @@ 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 @@ -265,8 +317,34 @@ 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 e5b4fd46b27f..f887fc86a97f 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,11 +62,14 @@ 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 @@ -77,11 +80,14 @@ 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); @@ -92,11 +98,16 @@ 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 @@ -107,11 +118,16 @@ 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); @@ -122,11 +138,18 @@ 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; @@ -140,11 +163,18 @@ 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 @@ -169,8 +199,28 @@ 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 bcddbf851244..283e769fab98 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 0706bc4688dd..11097df0680f 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,11 +713,20 @@ 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(), @@ -767,11 +776,20 @@ 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(), @@ -819,11 +837,20 @@ 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(), @@ -851,11 +878,20 @@ 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(), @@ -884,11 +920,20 @@ 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(), @@ -917,11 +962,20 @@ 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(), @@ -950,11 +1004,20 @@ 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 30c1594c6c2f..ff3259814cfd 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 a9b103647518..b5186d4e1eeb 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 48bd44be8546..e8c953433e6e 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 b27e910e5df6..1650c63c4ed3 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 7c7ce0e29061..2c2451a18350 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,8 +664,26 @@ 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 9b3cfc4cd14a..47def1381cc5 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,12 +244,15 @@ 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(); @@ -263,7 +266,7 @@ describe("Core/RectangleOutlineGeometry", function () { rectangle: rectangle, granularity: 1.0, offsetAttribute: GeometryOffsetAttribute.TOP, - }), + }) ); const positions = m.attributes.position.values; @@ -284,7 +287,7 @@ describe("Core/RectangleOutlineGeometry", function () { granularity: 1.0, extrudedHeight: 2, offsetAttribute: GeometryOffsetAttribute.TOP, - }), + }) ); const positions = m.attributes.position.values; @@ -305,7 +308,7 @@ describe("Core/RectangleOutlineGeometry", function () { granularity: 1.0, extrudedHeight: 2, offsetAttribute: GeometryOffsetAttribute.ALL, - }), + }) ); const positions = m.attributes.position.values; @@ -331,7 +334,7 @@ describe("Core/RectangleOutlineGeometry", function () { RectangleOutlineGeometry, rectangle, packedInstance, - "extruded", + "extruded" ); rectangle = new RectangleOutlineGeometry({ @@ -346,6 +349,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 daf087ae2362..1e13298a2986 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 23bf29e65580..61ca4a8890cd 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 71ad16c07887..d1f8f9c0ea76 100644 --- a/packages/engine/Specs/Core/RequestSchedulerSpec.js +++ b/packages/engine/Specs/Core/RequestSchedulerSpec.js @@ -21,8 +21,7 @@ describe("Core/RequestScheduler", function () { afterEach(function () { RequestScheduler.maximumRequests = originalMaximumRequests; - RequestScheduler.maximumRequestsPerServer = - originalMaximumRequestsPerServer; + RequestScheduler.maximumRequestsPerServer = originalMaximumRequestsPerServer; RequestScheduler.priorityHeapLength = originalPriorityHeapLength; RequestScheduler.requestsByServer = originalRequestsByServer; }); @@ -40,7 +39,7 @@ describe("Core/RequestScheduler", function () { requestFunction: function (url) { return undefined; }, - }), + }) ); }).toThrowDeveloperError(); }); @@ -50,7 +49,7 @@ describe("Core/RequestScheduler", function () { RequestScheduler.request( new Request({ url: "file/path", - }), + }) ); }).toThrowDeveloperError(); }); @@ -235,12 +234,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(); @@ -283,7 +282,7 @@ describe("Core/RequestScheduler", function () { } else { expect(statistics.numberOfActiveRequests).toBe(1); expect( - RequestScheduler.numberOfActiveRequestsByServer(request.serverKey), + RequestScheduler.numberOfActiveRequestsByServer(request.serverKey) ).toBe(1); } @@ -294,7 +293,7 @@ describe("Core/RequestScheduler", function () { expect(statistics.numberOfActiveRequests).toBe(0); if (!dataOrBlobUri) { expect( - RequestScheduler.numberOfActiveRequestsByServer(request.serverKey), + RequestScheduler.numberOfActiveRequestsByServer(request.serverKey) ).toBe(0); } }); @@ -407,7 +406,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(); @@ -768,18 +767,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"); @@ -812,10 +811,11 @@ 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,10 +842,11 @@ 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(); @@ -883,10 +884,11 @@ 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(); @@ -916,11 +918,12 @@ 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(); @@ -956,10 +959,11 @@ 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(); @@ -990,7 +994,7 @@ describe("Core/RequestScheduler", function () { requestFunction: function () { return deferred.promise; }, - }), + }) ); RequestScheduler.update(); expect(promise).toBeDefined(); @@ -1005,7 +1009,7 @@ describe("Core/RequestScheduler", function () { requestFunction: function () { return defer(); }, - }), + }) ); expect(promise).toBeUndefined(); @@ -1070,10 +1074,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 c4e50c3d2744..8ce027c2b09e 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,26 +698,24 @@ 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, { @@ -746,25 +744,23 @@ 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, @@ -795,26 +791,24 @@ 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, { @@ -843,25 +837,23 @@ 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, @@ -892,26 +884,24 @@ 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, { @@ -940,25 +930,23 @@ 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, @@ -975,7 +963,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); @@ -1071,7 +1059,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); @@ -1128,21 +1116,19 @@ 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) { @@ -1164,21 +1150,19 @@ 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) { @@ -1228,29 +1212,27 @@ describe("Core/Resource", function () { }; spyOn(window, "XMLHttpRequest").and.returnValue(fakeXHR); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake( - function ( + 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( url, responseType, method, data, headers, deferred, - overrideMimeType, - ) { - expect(url).toEqual(expectedUrl); - expect(method).toEqual("HEAD"); - Resource._DefaultImplementations.loadWithXhr( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType, - ); - }, - ); + overrideMimeType + ); + }); const resource = new Resource({ url: expectedUrl }); return resource.head().then(function (result) { @@ -1260,15 +1242,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"] ); }); }); @@ -1314,29 +1296,27 @@ describe("Core/Resource", function () { }; spyOn(window, "XMLHttpRequest").and.returnValue(fakeXHR); - spyOn(Resource._Implementations, "loadWithXhr").and.callFake( - function ( + 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( url, responseType, method, data, headers, deferred, - overrideMimeType, - ) { - expect(url).toEqual(expectedUrl); - expect(method).toEqual("OPTIONS"); - Resource._DefaultImplementations.loadWithXhr( - url, - responseType, - method, - data, - headers, - deferred, - overrideMimeType, - ); - }, - ); + overrideMimeType + ); + }); const resource = new Resource({ url: expectedUrl }); return resource.options().then(function (result) { @@ -1345,45 +1325,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 () { @@ -1534,7 +1514,7 @@ describe("Core/Resource", function () { } spyOn(Resource, "supportsImageBitmapOptions").and.returnValue( - Promise.resolve(false), + Promise.resolve(false) ); spyOn(window, "createImageBitmap").and.callThrough(); @@ -1570,7 +1550,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({ @@ -1593,17 +1573,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 () { @@ -1613,7 +1593,7 @@ describe("Core/Resource", function () { function () { deferred.resolve(); return fakeImage; - }, + } ); // mock image loading so that the promise resolves @@ -1625,7 +1605,7 @@ describe("Core/Resource", function () { function () { expect(imageConstructorSpy).toHaveBeenCalled(); expect(fakeImage.crossOrigin).toEqual(""); - }, + } ); }); @@ -1636,7 +1616,7 @@ describe("Core/Resource", function () { function () { deferred.resolve(); return fakeImage; - }, + } ); // mock image loading so that the promise resolves @@ -1657,7 +1637,7 @@ describe("Core/Resource", function () { function () { deferred.resolve(); return fakeImage; - }, + } ); // mock image loading so that the promise resolves @@ -1747,25 +1727,23 @@ 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, @@ -1780,19 +1758,17 @@ 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) { @@ -2167,7 +2143,7 @@ describe("Core/Resource", function () { responseType: "json", }).then(function (result) { expect(result).toEqual( - jasmine.objectContaining({ hello: "world" }), + jasmine.objectContaining({ hello: "world" }) ); }); }); @@ -2211,7 +2187,7 @@ describe("Core/Resource", function () { }; requestConstructorSpy = spyOn(window, "XMLHttpRequest").and.returnValue( - fakeXHR, + fakeXHR ); }); @@ -2513,7 +2489,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 ); }); }); @@ -2543,7 +2519,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 ); }); }); @@ -2577,7 +2553,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 ); }); }); @@ -2594,7 +2570,7 @@ describe("Core/Resource", function () { expect(name).toContain("loadJsonp"); expect(deferred).toBeDefined(); deferred.resolve(); - }, + } ); return Resource.fetchJsonp(testUrl); }); @@ -2615,7 +2591,7 @@ describe("Core/Resource", function () { function (url, functionName, deferred) { expect(url).toContain("callback=loadJsonp"); deferred.resolve(); - }, + } ); return Resource.fetchJsonp(testUrl, options); }); @@ -2628,7 +2604,7 @@ describe("Core/Resource", function () { spyOn(Resource._Implementations, "loadAndExecuteScript").and.callFake( function (url, functionName, deferred) { lastDeferred = deferred; - }, + } ); const resource = new Resource({ @@ -2670,7 +2646,7 @@ describe("Core/Resource", function () { spyOn(Resource._Implementations, "loadAndExecuteScript").and.callFake( function (url, functionName, deferred) { lastDeferred = deferred; - }, + } ); const resource = new Resource({ @@ -2707,7 +2683,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 6bb0947ac748..57a4f7ef2640 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 6aa4b9d1ad2a..58719b46a4b3 100644 --- a/packages/engine/Specs/Core/ScreenSpaceEventHandlerSpec.js +++ b/packages/engine/Specs/Core/ScreenSpaceEventHandlerSpec.js @@ -48,10 +48,9 @@ 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(); @@ -141,7 +140,7 @@ describe("Core/ScreenSpaceEventHandler", function () { if (defined(modifier)) { specName += ` with ${keyForValue( KeyboardEventModifier, - modifier, + modifier )} modifier`; } it(specName, function () { @@ -159,7 +158,7 @@ describe("Core/ScreenSpaceEventHandler", function () { specFunction, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ) { for (let i = 0; i < possibleButtons.length; ++i) { const eventType = possibleEventTypes[i]; @@ -177,7 +176,7 @@ describe("Core/ScreenSpaceEventHandler", function () { element, combine(options, { pointerType: "mouse", - }), + }) ); } else { DomEventSimulator.fireMouseDown(element, options); @@ -190,7 +189,7 @@ describe("Core/ScreenSpaceEventHandler", function () { element, combine(options, { pointerType: "mouse", - }), + }) ); } else { DomEventSimulator.fireMouseUp(element, options); @@ -203,7 +202,7 @@ describe("Core/ScreenSpaceEventHandler", function () { element, combine(options, { pointerType: "mouse", - }), + }) ); } else { DomEventSimulator.fireMouseMove(element, options); @@ -225,8 +224,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); } @@ -267,7 +266,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseDownEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); @@ -287,8 +286,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); simulateMouseUp( element, @@ -297,8 +296,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); } @@ -320,8 +319,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); simulateMouseMove( element, @@ -330,8 +329,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 10, clientY: 11, }, - eventOptions, - ), + eventOptions + ) ); simulateMouseUp( element, @@ -340,8 +339,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 10, clientY: 11, }, - eventOptions, - ), + eventOptions + ) ); } @@ -383,7 +382,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseUpEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); @@ -403,8 +402,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); simulateMouseUp( element, @@ -413,8 +412,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); } @@ -434,8 +433,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); simulateMouseUp( element, @@ -444,8 +443,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 10, clientY: 11, }, - eventOptions, - ), + eventOptions + ) ); expect(action).not.toHaveBeenCalled(); @@ -480,7 +479,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseClickEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); @@ -499,8 +498,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); } @@ -533,7 +532,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseDoubleClickEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); @@ -552,8 +551,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 1, clientY: 2, }, - eventOptions, - ), + eventOptions + ) ); simulateMouseMove( element, @@ -562,8 +561,8 @@ describe("Core/ScreenSpaceEventHandler", function () { clientX: 2, clientY: 3, }, - eventOptions, - ), + eventOptions + ) ); } @@ -597,7 +596,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseMoveEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); @@ -617,8 +616,8 @@ describe("Core/ScreenSpaceEventHandler", function () { { deltaY: 120, }, - eventOptions, - ), + eventOptions + ) ); } @@ -651,7 +650,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testWheelEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); } else if (document.onmousewheel !== undefined) { @@ -669,8 +668,8 @@ describe("Core/ScreenSpaceEventHandler", function () { { wheelDelta: -120, }, - eventOptions, - ), + eventOptions + ) ); } @@ -701,7 +700,7 @@ describe("Core/ScreenSpaceEventHandler", function () { testMouseWheelEvent, possibleButtons, possibleModifiers, - possibleEventTypes, + possibleEventTypes ); }); } @@ -729,8 +728,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -739,7 +738,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -790,8 +789,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerMove( element, @@ -800,8 +799,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchMovePosition, - ), + touchMovePosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -810,7 +809,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -820,7 +819,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchMovePosition, + touchMovePosition ), ], }); @@ -872,8 +871,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerUp( element, @@ -882,8 +881,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -892,7 +891,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -902,7 +901,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -941,8 +940,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerMove( element, @@ -951,8 +950,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchMovePosition, - ), + touchMovePosition + ) ); DomEventSimulator.firePointerUp( element, @@ -961,8 +960,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -971,7 +970,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -981,7 +980,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchMovePosition, + touchMovePosition ), ], }); @@ -991,7 +990,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -1043,8 +1042,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerCancel( element, @@ -1053,8 +1052,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1063,7 +1062,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -1073,7 +1072,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -1112,8 +1111,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerMove( element, @@ -1122,8 +1121,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchMovePosition, - ), + touchMovePosition + ) ); DomEventSimulator.firePointerCancel( element, @@ -1132,8 +1131,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1142,7 +1141,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -1152,7 +1151,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchMovePosition, + touchMovePosition ), ], }); @@ -1162,7 +1161,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -1214,8 +1213,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1StartPosition, - ), + touch1StartPosition + ) ); DomEventSimulator.firePointerDown( element, @@ -1224,8 +1223,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2StartPosition, - ), + touch2StartPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1234,7 +1233,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition, + touch1StartPosition ), ], }); @@ -1244,13 +1243,13 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition, + touch1StartPosition ), combine( { identifier: 1, }, - touch2StartPosition, + touch2StartPosition ), ], }); @@ -1310,8 +1309,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1StartPosition, - ), + touch1StartPosition + ) ); DomEventSimulator.firePointerDown( element, @@ -1320,8 +1319,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2StartPosition, - ), + touch2StartPosition + ) ); DomEventSimulator.firePointerMove( element, @@ -1330,8 +1329,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1MovePosition, - ), + touch1MovePosition + ) ); DomEventSimulator.firePointerMove( element, @@ -1340,8 +1339,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2MovePosition, - ), + touch2MovePosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1350,7 +1349,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition, + touch1StartPosition ), ], }); @@ -1360,13 +1359,13 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1StartPosition, + touch1StartPosition ), combine( { identifier: 1, }, - touch2StartPosition, + touch2StartPosition ), ], }); @@ -1376,13 +1375,13 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touch1MovePosition, + touch1MovePosition ), combine( { identifier: 1, }, - touch2MovePosition, + touch2MovePosition ), ], }); @@ -1476,8 +1475,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1Position, - ), + touch1Position + ) ); DomEventSimulator.firePointerDown( element, @@ -1486,8 +1485,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2Position, - ), + touch2Position + ) ); // Releasing one of two fingers should not trigger @@ -1500,8 +1499,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch1Position, - ), + touch1Position + ) ); expect(pinchEndAction).not.toHaveBeenCalled(); expect(leftDownAction).not.toHaveBeenCalled(); @@ -1517,8 +1516,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch2Position, - ), + touch2Position + ) ); expect(pinchStartAction).not.toHaveBeenCalled(); @@ -1530,8 +1529,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touch2Position, - ), + touch2Position + ) ); DomEventSimulator.firePointerUp( element, @@ -1540,8 +1539,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 2, }, - touch2Position, - ), + touch2Position + ) ); expect(pinchEndAction).toHaveBeenCalled(); } else { @@ -1598,8 +1597,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerUp( element, @@ -1608,8 +1607,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1618,7 +1617,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -1628,7 +1627,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -1683,8 +1682,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); jasmine.clock().tick(timeout); DomEventSimulator.firePointerUp( @@ -1694,8 +1693,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1704,7 +1703,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -1715,7 +1714,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -1784,8 +1783,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchStartPosition, - ), + touchStartPosition + ) ); DomEventSimulator.firePointerCancel( element, @@ -1794,8 +1793,8 @@ describe("Core/ScreenSpaceEventHandler", function () { pointerType: "touch", pointerId: 1, }, - touchEndPosition, - ), + touchEndPosition + ) ); } else { DomEventSimulator.fireTouchStart(element, { @@ -1804,7 +1803,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchStartPosition, + touchStartPosition ), ], }); @@ -1814,7 +1813,7 @@ describe("Core/ScreenSpaceEventHandler", function () { { identifier: 0, }, - touchEndPosition, + touchEndPosition ), ], }); @@ -1858,7 +1857,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 ebfe89da903b..ccccf6ddd37c 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 51b47155d828..01d26b41a644 100644 --- a/packages/engine/Specs/Core/Simon1994PlanetaryPositionsSpec.js +++ b/packages/engine/Specs/Core/Simon1994PlanetaryPositionsSpec.js @@ -84,15 +84,14 @@ describe("Core/Simon1994PlanetaryPositions", function () { for (i = 0; i < 24; i++) { transformMatrix = Transforms.computeIcrfToCentralBodyFixedMatrix( timesOfDay[i], - transformMatrix, + transformMatrix + ); + const position = PlanetaryPositions.computeSunPositionInEarthInertialFrame( + timesOfDay[i] ); - 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 c4c8713f5c71..1375664dfda4 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,11 +144,19 @@ 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); @@ -171,7 +179,7 @@ describe("Core/SimplePolylineGeometry", function () { positions: positions, colors: colors, arcType: ArcType.NONE, - }), + }) ); expect(line.attributes.color).toBeDefined(); @@ -197,7 +205,7 @@ describe("Core/SimplePolylineGeometry", function () { colors: colors, colorsPerVertex: true, arcType: ArcType.NONE, - }), + }) ); expect(line.attributes.color).toBeDefined(); @@ -220,14 +228,41 @@ 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({ @@ -253,7 +288,7 @@ describe("Core/SimplePolylineGeometry", function () { SimplePolylineGeometry, line, packedInstance, - "geodesic line", + "geodesic line" ); line = new SimplePolylineGeometry({ @@ -269,7 +304,7 @@ describe("Core/SimplePolylineGeometry", function () { SimplePolylineGeometry, line, packedInstance, - "rhumb line", + "rhumb line" ); line = new SimplePolylineGeometry({ @@ -285,6 +320,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 6c05a8f85192..d4aa38e45c5e 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 973677b2890b..fe20690fb5bb 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 3e38416c67a4..c5515a14f861 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 94570c49ce62..8a38ca5a2acb 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 285e8b39bd36..60c742a4b3c7 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 9279ca0ba673..80c541b87769 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,10 +195,11 @@ 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); @@ -207,7 +208,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"; @@ -216,11 +217,12 @@ 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); @@ -230,7 +232,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, @@ -247,7 +249,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); @@ -265,7 +267,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); @@ -273,7 +275,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 b6a896a3be58..3856b6a59521 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 fe4766f80417..6dabad854007 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 f365491cb12f..707215ec6292 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 ec596303ab8c..465c1382f83e 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 354d5630ff83..df81516f5aa3 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,12 +93,117 @@ 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, @@ -120,15 +225,120 @@ 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 a879b23d9a35..1f2277b58330 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,8 +701,10 @@ 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); } }); @@ -744,7 +746,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()); @@ -757,19 +759,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); @@ -786,7 +788,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()); @@ -799,19 +801,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); @@ -828,7 +830,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()); @@ -842,19 +844,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); @@ -871,7 +873,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()); @@ -887,19 +889,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); @@ -917,17 +919,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 @@ -935,19 +937,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(); @@ -956,19 +958,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); @@ -979,32 +981,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); @@ -1024,7 +1026,7 @@ describe("Core/Transforms", function () { const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE, + Ellipsoid.UNIT_SPHERE ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1032,7 +1034,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); @@ -1048,7 +1050,7 @@ describe("Core/Transforms", function () { const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE, + Ellipsoid.UNIT_SPHERE ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1058,7 +1060,7 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, Transforms.eastNorthUpToFixedFrame, - result, + result ); const actual = Matrix3.fromQuaternion(quaternion); expect(quaternion).toBe(result); @@ -1075,7 +1077,7 @@ describe("Core/Transforms", function () { const transform = Transforms.headingPitchRollToFixedFrame( origin, hpr, - Ellipsoid.UNIT_SPHERE, + Ellipsoid.UNIT_SPHERE ); const expected = Matrix4.getMatrix3(transform, new Matrix3()); @@ -1085,7 +1087,7 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, undefined, - result, + result ); const actual = Matrix3.fromQuaternion(quaternion); expect(quaternion).toBe(result); @@ -1100,14 +1102,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()); @@ -1117,7 +1119,7 @@ describe("Core/Transforms", function () { hpr, Ellipsoid.UNIT_SPHERE, fixedFrameTransform, - result, + result ); const actual = Matrix3.fromQuaternion(quaternion); expect(quaternion).toBe(result); @@ -1142,11 +1144,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 @@ -1175,7 +1177,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 @@ -1206,7 +1208,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 @@ -1251,7 +1253,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 @@ -1271,13 +1273,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++) { @@ -1285,7 +1287,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1294,8 +1296,9 @@ 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(); @@ -1323,17 +1326,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); @@ -1355,19 +1358,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++) { @@ -1375,7 +1378,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); } @@ -1388,7 +1391,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); @@ -1408,7 +1411,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 @@ -1429,13 +1432,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++) { @@ -1443,7 +1446,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1454,7 +1457,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); @@ -1469,13 +1472,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++) { @@ -1483,7 +1486,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1494,7 +1497,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); @@ -1509,13 +1512,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++) { @@ -1523,7 +1526,7 @@ describe("Core/Transforms", function () { } expect(testInverse).toEqualEpsilon( Matrix3.IDENTITY, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ); expect(testDiff).toEqualEpsilon(new Matrix3(), CesiumMath.EPSILON14); }); @@ -1533,13 +1536,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 @@ -1548,7 +1551,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); @@ -1557,7 +1560,7 @@ describe("Core/Transforms", function () { const error = Cartesian3.subtract( result, expectedFixedPos, - new Cartesian3(), + new Cartesian3() ); // Given the magnitude of the positions involved (1e8) @@ -1573,7 +1576,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(); @@ -1590,7 +1593,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); @@ -1602,13 +1605,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 @@ -1623,7 +1626,7 @@ describe("Core/Transforms", function () { const error = Cartesian3.subtract( result, expectedFixedPos, - new Cartesian3(), + new Cartesian3() ); // Given the magnitude of the positions involved (1e8) @@ -1640,13 +1643,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." ); }); @@ -1666,7 +1669,7 @@ describe("Core/Transforms", function () { width / height, 1.0, 10.0, - new Matrix4(), + new Matrix4() ); const vpTransform = Matrix4.computeViewportTransformation( { @@ -1675,7 +1678,7 @@ describe("Core/Transforms", function () { }, 0, 1, - new Matrix4(), + new Matrix4() ); it("pointToGLWindowCoordinates works at the center", function () { @@ -1683,7 +1686,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, @@ -1694,7 +1697,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToGLWindowCoordinates( mvpMatrix, vpTransform, - Cartesian3.ZERO, + Cartesian3.ZERO ); expect(returnedResult).toEqual(expected); }); @@ -1704,7 +1707,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, @@ -1717,7 +1720,7 @@ describe("Core/Transforms", function () { mvpMatrix, vpTransform, Cartesian3.ZERO, - result, + result ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expected); @@ -1734,7 +1737,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToGLWindowCoordinates( perspective, vpTransform, - point, + point ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1750,7 +1753,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToGLWindowCoordinates( perspective, vpTransform, - point, + point ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1760,7 +1763,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, @@ -1771,7 +1774,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToWindowCoordinates( mvpMatrix, vpTransform, - Cartesian3.ZERO, + Cartesian3.ZERO ); expect(returnedResult).toEqual(expected); }); @@ -1781,7 +1784,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, @@ -1794,7 +1797,7 @@ describe("Core/Transforms", function () { mvpMatrix, vpTransform, Cartesian3.ZERO, - result, + result ); expect(result).toBe(returnedResult); expect(returnedResult).toEqual(expected); @@ -1811,7 +1814,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToWindowCoordinates( perspective, vpTransform, - point, + point ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1827,7 +1830,7 @@ describe("Core/Transforms", function () { const returnedResult = Transforms.pointToWindowCoordinates( perspective, vpTransform, - point, + point ); expect(returnedResult).toEqualEpsilon(expected, CesiumMath.EPSILON12); }); @@ -1835,21 +1838,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); @@ -1861,7 +1864,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); @@ -1870,7 +1873,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); @@ -1879,7 +1882,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); @@ -1897,16 +1900,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); @@ -1928,12 +1931,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()); @@ -1944,7 +1947,7 @@ describe("Core/Transforms", function () { const hprPlusTranslate = Matrix4.multiply( enuInverse, modelMatrix, - new Matrix4(), + new Matrix4() ); const hpr2 = Matrix4.getMatrix3(hprPlusTranslate, new Matrix3()); @@ -1968,7 +1971,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); @@ -1977,19 +1980,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(); @@ -2001,7 +2004,7 @@ describe("Core/Transforms", function () { expect(actualTranslation).toEqualEpsilon( expectedTranslation, - CesiumMath.EPSILON14, + CesiumMath.EPSILON14 ); }); @@ -2009,12 +2012,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); @@ -2050,7 +2053,7 @@ describe("Core/Transforms", function () { expect(function () { Transforms.headingPitchRollToFixedFrame( undefined, - new HeadingPitchRoll(), + new HeadingPitchRoll() ); }).toThrowDeveloperError(); }); @@ -2072,7 +2075,7 @@ describe("Core/Transforms", function () { Transforms.pointToWindowCoordinates( undefined, Matrix4.IDENTITY, - Cartesian3.ZERO, + Cartesian3.ZERO ); }).toThrowDeveloperError(); }); @@ -2082,7 +2085,7 @@ describe("Core/Transforms", function () { Transforms.pointToWindowCoordinates( Matrix4.IDENTITY, undefined, - Cartesian3.ZERO, + Cartesian3.ZERO ); }).toThrowDeveloperError(); }); @@ -2092,7 +2095,7 @@ describe("Core/Transforms", function () { Transforms.pointToWindowCoordinates( Matrix4.IDENTITY, Matrix4.IDENTITY, - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -2108,7 +2111,7 @@ describe("Core/Transforms", function () { Transforms.basisTo2D( new GeographicProjection(), undefined, - new Matrix4(), + new Matrix4() ); }).toThrowDeveloperError(); }); @@ -2118,7 +2121,7 @@ describe("Core/Transforms", function () { Transforms.basisTo2D( new GeographicProjection(), Matrix4.IDENTITY, - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -2128,7 +2131,7 @@ describe("Core/Transforms", function () { Transforms.ellipsoidTo2DModelMatrix( undefined, Cartesian3.UNIT_X, - new Matrix4(), + new Matrix4() ); }).toThrowDeveloperError(); }); @@ -2138,7 +2141,7 @@ describe("Core/Transforms", function () { Transforms.ellipsoidTo2DModelMatrix( new GeographicProjection(), undefined, - new Matrix4(), + new Matrix4() ); }).toThrowDeveloperError(); }); @@ -2148,7 +2151,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 ad3afec38d79..c673745259eb 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 15db6f082ce6..b96c8720ab31 100644 --- a/packages/engine/Specs/Core/TridiagonalSystemSolverSpec.js +++ b/packages/engine/Specs/Core/TridiagonalSystemSolverSpec.js @@ -73,7 +73,14 @@ 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 77efce7480ed..f5a174a0f8d5 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 900ca48d8131..a4103ae80051 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 f14735bc596c..85acde809a35 100644 --- a/packages/engine/Specs/Core/VertexFormatSpec.js +++ b/packages/engine/Specs/Core/VertexFormatSpec.js @@ -23,9 +23,12 @@ 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 e429cf93c09f..1d261e5c9791 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 642011a73da8..2b7e578238d1 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 c7667e7217f3..d8f430d9f0ab 100644 --- a/packages/engine/Specs/Core/WallGeometrySpec.js +++ b/packages/engine/Specs/Core/WallGeometrySpec.js @@ -39,9 +39,17 @@ 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(); }); @@ -50,19 +58,29 @@ 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(); }); @@ -72,10 +90,12 @@ 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, ]), - }), + }) ); }); @@ -84,9 +104,14 @@ 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; @@ -96,12 +121,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); }); @@ -111,10 +136,23 @@ 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; @@ -124,12 +162,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); }); @@ -139,11 +177,16 @@ 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; @@ -153,22 +196,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); }); @@ -178,11 +221,29 @@ 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; @@ -192,12 +253,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); }); @@ -210,25 +271,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; @@ -258,7 +319,7 @@ describe("Core/WallGeometry", function () { new WallGeometry({ vertexFormat: VertexFormat.POSITION_ONLY, positions: inputPositions, - }), + }) ); expect(w).toBeDefined(); @@ -274,11 +335,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 ); }); @@ -287,10 +348,23 @@ 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; @@ -300,12 +374,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); }); @@ -315,9 +389,17 @@ 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; @@ -335,14 +417,36 @@ 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, ]); }); @@ -352,15 +456,39 @@ 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, ]); }); @@ -379,11 +507,16 @@ 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; @@ -393,22 +526,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); }); @@ -425,8 +558,28 @@ 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 7b4777cd3a29..42435f0eb47c 100644 --- a/packages/engine/Specs/Core/WallOutlineGeometrySpec.js +++ b/packages/engine/Specs/Core/WallOutlineGeometrySpec.js @@ -38,9 +38,17 @@ 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(); }); @@ -49,19 +57,29 @@ 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(); }); @@ -70,10 +88,15 @@ 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; @@ -81,12 +104,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); }); @@ -95,12 +118,17 @@ 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; @@ -108,22 +136,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); }); @@ -132,11 +160,29 @@ 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; @@ -144,12 +190,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); }); @@ -167,11 +213,16 @@ 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; @@ -179,22 +230,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); }); @@ -210,7 +261,21 @@ 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 5c0045d22f8c..e8c8d0eee172 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 985be4a81ce8..8c1b325fbeac 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,32 +256,33 @@ 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 ); }); @@ -291,34 +292,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 ); }); }); @@ -329,10 +330,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) ), }); @@ -351,18 +352,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)); }); @@ -371,7 +372,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) ); }); @@ -380,7 +381,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) ); }); @@ -389,13 +390,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 ade29ffccce7..1ece2697105e 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 2c6d52337fde..c60d227362c3 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 8cb95a15b3a4..fa7bd7714a78 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 767af70e54b7..3b8f81d46388 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 7013370154a2..c2ab34ca0b24 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 9339e3b28102..3d5d6dd994b4 100644 --- a/packages/engine/Specs/Core/createGuidSpec.js +++ b/packages/engine/Specs/Core/createGuidSpec.js @@ -2,8 +2,7 @@ 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 0cfb50541ada..9d4b1d11b575 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 13c095001d77..909941e6dd8c 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 3e19accb260b..7817f7493c79 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 7c7fa482a6e6..71611a9ff752 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 5ea515ebd778..0c348a6665d9 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 9f6fb85bb7f3..f3a238635dea 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 698f6ef538ba..bc73ccd2086c 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 56d9fb783f04..e046e41f28a1 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 77239352ab6f..931a7ff67fe7 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 9649ad6a11e0..77635449b0d9 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 1c7ef5b2f0cd..ce265ee5ca58 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,28 +173,31 @@ 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 @@ -205,7 +208,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 ); }) ); @@ -223,7 +226,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); @@ -241,8 +244,8 @@ describe("Core/sampleTerrain", function () { if (!defined(proxiedUrl)) { throw new Error( `Unexpected XHR load to url: ${url}; spec includes: ${availablePaths.join( - ", ", - )}`, + ", " + )}` ); } @@ -254,7 +257,7 @@ describe("Core/sampleTerrain", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; } @@ -265,22 +268,23 @@ 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; @@ -307,22 +311,23 @@ 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; @@ -351,29 +356,33 @@ 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 68fd9c52383c..6da4f355301c 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 b0b10a7ceebc..a01bec49ccbf 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 5dd917aeb550..55d6932c9fbd 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 aa71c78b741d..6c1a2080f629 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 8668e22daf7a..c9c2470f89aa 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 be59405ccd3c..37d85b422952 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 0c9ef09da4fe..95c9db6e8767 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 31f11faea7e0..26a349ac869f 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 47da83aea010..f3b6b0bd2f4f 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 093e32c15d9d..bf0194423096 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 703a67111cae..8d9263c0f7ba 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 4811bf078653..0d4c734aeef8 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 599a4446c955..6f455e96ce6e 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 a18b4cc398ae..1f311c4d7d0d 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 b6edf9c6f11c..ff00f1535d99 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 75cc56d36cc8..acc20e7caa8e 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 735d0e24eb30..492d54fd31bc 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,55 +761,53 @@ 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 () { @@ -850,45 +848,41 @@ 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.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), - ); + expect(entity.billboard).toBeDefined(); + expect(entity.ellipsoid).toBeDefined(); - 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), - ); + // 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(); - // 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(); - }, - ); + // 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) + ); + + // 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 () { @@ -921,18 +915,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); }); }); @@ -964,30 +958,24 @@ 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) ); }); }); @@ -1032,35 +1020,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); }); }); @@ -1112,33 +1100,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)); }); }); @@ -1155,25 +1143,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 () { @@ -1192,31 +1180,27 @@ 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 () { @@ -1231,25 +1215,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 () { @@ -1264,25 +1248,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 () { @@ -1308,7 +1292,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]); @@ -1323,15 +1307,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 () { @@ -1349,8 +1333,8 @@ describe("DataSources/CzmlDataSource", function () { cartesianFromArrayDegrees( packet.position.cartographicDegrees, 0, - Ellipsoid.default, - ), + Ellipsoid.default + ) ); Ellipsoid.default = Ellipsoid.WGS84; }); @@ -1369,14 +1353,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) ); }); @@ -1403,12 +1387,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) ); }); @@ -1423,7 +1407,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) ); }); @@ -1442,8 +1426,8 @@ describe("DataSources/CzmlDataSource", function () { cartesianFromArrayRadians( packet.position.cartographicRadians, 0, - Ellipsoid.default, - ), + Ellipsoid.default + ) ); Ellipsoid.default = Ellipsoid.WGS84; }); @@ -1458,22 +1442,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 () { @@ -1520,12 +1504,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 () { @@ -1578,16 +1562,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 () { @@ -1599,17 +1583,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 () { @@ -1624,22 +1608,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 () { @@ -1651,19 +1635,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(), - ); - 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 () { @@ -1678,22 +1660,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 () { @@ -1715,40 +1697,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 () { @@ -1762,43 +1744,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 () { @@ -1829,43 +1811,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 () { @@ -1892,30 +1874,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 () { @@ -1952,51 +1934,49 @@ 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 () { @@ -2031,66 +2011,58 @@ 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]; - - 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, - ); + return CzmlDataSource.load(makeDocument(packet)).then(function ( + dataSource + ) { + const entity = dataSource.entities.values[0]; - 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 () { @@ -2105,21 +2077,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 () { @@ -2131,14 +2103,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 () { @@ -2150,14 +2122,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 () { @@ -2172,12 +2144,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 () { @@ -2206,17 +2178,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 () { @@ -2230,33 +2202,34 @@ 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 () { @@ -2270,14 +2243,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 () { @@ -2291,16 +2264,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 () { @@ -2314,16 +2287,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 () { @@ -2335,14 +2308,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 () { @@ -2352,12 +2325,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 () { @@ -2384,23 +2357,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 () { @@ -2430,23 +2403,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 () { @@ -2459,22 +2432,18 @@ 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 () { @@ -2487,22 +2456,18 @@ 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 () { @@ -2523,22 +2488,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 () { @@ -2562,30 +2527,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 () { @@ -2606,22 +2571,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 () { @@ -2635,42 +2600,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 () { @@ -2789,279 +2754,264 @@ 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 () { @@ -3161,7 +3111,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); @@ -3339,7 +3289,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); @@ -3405,18 +3355,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; @@ -3439,19 +3389,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); }); }); @@ -3480,18 +3430,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; @@ -3514,19 +3464,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); }); }); @@ -3547,18 +3497,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; @@ -3579,19 +3529,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)); }); }); @@ -3617,18 +3567,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; @@ -3648,28 +3598,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); }); }); @@ -3693,18 +3643,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; @@ -3722,28 +3672,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)); }); }); @@ -3784,38 +3734,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; @@ -3838,38 +3788,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); }); }); @@ -3914,38 +3864,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; @@ -3966,38 +3916,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)); }); }); @@ -4062,16 +4012,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. @@ -4080,16 +4030,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. @@ -4098,16 +4048,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 ); }); }); @@ -4212,33 +4162,31 @@ 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 () { @@ -4269,41 +4217,39 @@ 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 () { @@ -4330,37 +4276,35 @@ 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 () { @@ -4384,34 +4328,32 @@ 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 () { @@ -4444,53 +4386,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 () { @@ -4514,26 +4456,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 () { @@ -4547,39 +4489,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) ); } @@ -4600,28 +4542,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 () { @@ -4631,7 +4573,18 @@ 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, ], }, { @@ -4642,35 +4595,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 () { @@ -4680,7 +4633,18 @@ 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, ], }, { @@ -4704,50 +4668,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) ); } @@ -4758,9 +4722,18 @@ 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, ], }, ], @@ -4769,9 +4742,18 @@ 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, ], ], }, @@ -4779,30 +4761,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) { @@ -4827,26 +4809,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 () { @@ -4946,7 +4928,18 @@ 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: [ @@ -4970,7 +4963,18 @@ 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, ], }, { @@ -4987,7 +4991,7 @@ describe("DataSources/CzmlDataSource", function () { return CzmlDataSource.load(document).then(function (dataSource) { let entity = dataSource.entities.getById( - "constantPositionsTimeVaryingHoles", + "constantPositionsTimeVaryingHoles" ); expect(entity.polygon).toBeDefined(); @@ -5025,36 +5029,34 @@ 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 () { @@ -5083,40 +5085,38 @@ 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,36 +5142,34 @@ 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 () { @@ -5215,33 +5213,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` @@ -5257,7 +5255,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) ); }); }); @@ -5269,7 +5267,8 @@ 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", @@ -5305,96 +5304,92 @@ 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 () { @@ -5404,7 +5399,8 @@ 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", @@ -5443,150 +5439,137 @@ 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 () { @@ -5626,54 +5609,53 @@ 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 () { @@ -5697,39 +5679,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 () { @@ -5828,7 +5810,7 @@ describe("DataSources/CzmlDataSource", function () { JulianDate, object, "simpleDate", - JulianDate.toIso8601(date), + JulianDate.toIso8601(date) ); expect(object.simpleDate).toBeDefined(); @@ -5892,7 +5874,7 @@ describe("DataSources/CzmlDataSource", function () { new TimeInterval({ start: startTime, stop: stopTime, - }), + }) ); } @@ -5943,41 +5925,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 + ) ); } @@ -6014,15 +5996,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 + ) + ) ); }); }); @@ -6059,55 +6041,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 () { @@ -6121,14 +6103,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 () { @@ -6143,25 +6125,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 () { @@ -6176,26 +6158,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 () { @@ -6227,36 +6209,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 () { @@ -6355,18 +6337,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]); }); }); @@ -6396,30 +6378,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 () { @@ -6449,46 +6431,44 @@ 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 () { @@ -6523,55 +6503,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.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 () { @@ -6581,12 +6559,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 () { @@ -6618,7 +6596,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) ); }); }); @@ -6667,10 +6645,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) ); }); }); @@ -6703,7 +6681,7 @@ describe("DataSources/CzmlDataSource", function () { expect(referenceObject.position).toBeInstanceOf(ReferenceProperty); expect(targetEntity.position.getValue(time)).toEqual( - referenceObject.position.getValue(time), + referenceObject.position.getValue(time) ); }); }); @@ -6750,10 +6728,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) ); }); }); @@ -6787,7 +6765,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) ); }); }); @@ -6804,17 +6782,15 @@ 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 () { @@ -6833,21 +6809,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 () { @@ -6864,15 +6840,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 () { @@ -6891,21 +6867,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 () { @@ -6929,38 +6905,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 () { @@ -6973,7 +6949,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." ); }); }); @@ -6988,7 +6964,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." ); }); }); @@ -7003,7 +6979,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." ); }); }); @@ -7017,14 +6993,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 () { @@ -7036,14 +7012,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 () { @@ -7103,13 +7079,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 3bb3a4208104..566532c75a79 100644 --- a/packages/engine/Specs/DataSources/DataSourceCollectionSpec.js +++ b/packages/engine/Specs/DataSources/DataSourceCollectionSpec.js @@ -154,13 +154,14 @@ 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]), @@ -183,13 +184,14 @@ 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 7169eb3414ee..fea15067b3e5 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 9b4533d52a31..3d908213f4be 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 d2549e89b0ca..75ac52a43e41 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 bd88399496ff..587e63e4517e 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 767061d8bbba..15429632c911 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 3a31b4213f7e..adb4edd3efc0 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 e1c70e5e3fd3..2d4aa8beb9ce 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,13 +581,14 @@ 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); @@ -596,7 +597,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - farDepth, + farDepth ); entity = new Entity(); @@ -606,7 +607,7 @@ describe( point.position = SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - farDepth, + farDepth ); const frameState = scene.frameState; @@ -636,7 +637,7 @@ describe( dataSource._visualizers = DataSourceDisplay.defaultVisualizersCallback( scene, cluster, - dataSource, + dataSource ); const entityCollection = dataSource.entities; @@ -645,7 +646,7 @@ describe( position: SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(0.0, 0.0), - depth, + depth ), billboard: { image: createBillboardImage(), @@ -659,7 +660,7 @@ describe( position: SceneTransforms.drawingBufferToWorldCoordinates( scene, new Cartesian2(scene.canvas.clientWidth, scene.canvas.clientHeight), - depth, + depth ), billboard: { image: createBillboardImage(), @@ -692,5 +693,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 a00f5d431079..a8b94f763355 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 4edfdbffc4da..f38163f0d0e3 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 1406cf8207d3..5cba71e6ca8b 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 c702bea93968..aff11fe035c4 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,23 +1166,24 @@ 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 () { @@ -1199,7 +1200,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) ); }); }); @@ -1229,16 +1230,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"] ); }); }); @@ -1269,10 +1270,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 ); }); }); @@ -1306,10 +1307,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 ); }); }); @@ -1346,24 +1347,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 ); }); }); @@ -1401,14 +1402,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 ); }); }); @@ -1449,17 +1450,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 ); }); }); @@ -1516,7 +1517,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" ); }); }); @@ -1538,11 +1539,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 () { @@ -1626,7 +1627,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 4aec38f38203..79da7d2f5a34 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 26d4c323ef09..39b3e15e293d 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 1cea7ceba254..8b8aae5048a2 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 73224a389d60..8c9152c1572f 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 0986d5119394..efeb61875a5d 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 35c1980dd34a..1b52765079f3 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 aee441645283..7bd5eeaa214a 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 ba8b4d048e04..0fe44e005c4b 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,10 +1573,9 @@ 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); @@ -1600,10 +1599,9 @@ 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); @@ -1626,7 +1624,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(); }); @@ -1647,7 +1645,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1682,7 +1680,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1718,7 +1716,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); @@ -1748,7 +1746,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1787,7 +1785,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1818,7 +1816,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1861,7 +1859,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1906,7 +1904,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1951,7 +1949,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -1998,7 +1996,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); @@ -2026,7 +2024,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); @@ -2055,7 +2053,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); @@ -2084,7 +2082,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); @@ -2103,7 +2101,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(); @@ -2125,12 +2123,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" ); }); }); @@ -2150,12 +2148,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" ); }); }); @@ -2179,19 +2177,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 () { @@ -2218,12 +2216,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) ); }); }); @@ -2241,7 +2239,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)); @@ -2261,7 +2259,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)); @@ -2281,7 +2279,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)); @@ -2302,7 +2300,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); @@ -2322,7 +2320,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); @@ -2342,14 +2340,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 ); }); }); @@ -2379,7 +2377,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2391,7 +2389,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]" ); }); }); @@ -2409,7 +2407,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2430,7 +2428,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2465,7 +2463,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2505,7 +2503,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(); @@ -2521,7 +2519,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2565,7 +2563,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2589,7 +2587,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load( parser.parseFromString(kml, "text/xml"), - options, + options ).then(function (dataSource) { const entity = dataSource.entities.values[0]; @@ -2602,27 +2600,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 () { @@ -2637,7 +2635,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; @@ -2668,7 +2666,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) ); }); }); @@ -2687,7 +2685,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); @@ -2709,11 +2707,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) ); }); }); @@ -2731,11 +2729,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) ); }); }); @@ -2753,7 +2751,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(); @@ -2773,7 +2771,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; @@ -2802,7 +2800,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; @@ -2824,7 +2822,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; @@ -2844,7 +2842,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; @@ -2880,7 +2878,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; @@ -2902,7 +2900,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; @@ -2923,7 +2921,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; @@ -2941,7 +2939,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"); @@ -2967,7 +2965,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"); @@ -3000,7 +2998,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"); @@ -3032,7 +3030,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"); @@ -3063,7 +3061,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"); @@ -3091,12 +3089,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(); }); @@ -3114,12 +3112,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(); }); @@ -3136,12 +3134,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(); }); @@ -3162,7 +3160,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(); }); @@ -3180,12 +3178,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(); @@ -3204,12 +3202,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(); @@ -3229,12 +3227,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(); @@ -3255,12 +3253,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(); }); @@ -3279,21 +3277,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 ); }); }); @@ -3312,21 +3310,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 ); }); }); @@ -3344,21 +3342,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 ); }); }); @@ -3374,15 +3372,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 ); }); }); @@ -3399,15 +3397,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 ); }); }); @@ -3428,7 +3426,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(); @@ -3454,7 +3452,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 = [ @@ -3463,7 +3461,7 @@ describe("DataSources/KmlDataSource", function () { Cartesian3.fromDegrees(7, 8, 9), ]; expect(entity.polygon.hierarchy.getValue().positions).toEqual( - coordinates, + coordinates ); }); }); @@ -3505,7 +3503,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 = [ @@ -3548,7 +3546,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); @@ -3568,7 +3566,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); @@ -3589,7 +3587,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(); @@ -3610,7 +3608,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); @@ -3631,7 +3629,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(); @@ -3660,13 +3658,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 ); }); }); @@ -3691,13 +3689,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 ); }); }); @@ -3712,7 +3710,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); @@ -3737,7 +3735,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); @@ -3747,11 +3745,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); }); @@ -3772,7 +3770,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); @@ -3784,7 +3782,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 ); }); }); @@ -3803,7 +3801,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); @@ -3811,11 +3809,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 ); }); }); @@ -3835,7 +3833,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); @@ -3843,11 +3841,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 ); }); }); @@ -3867,7 +3865,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); @@ -3878,7 +3876,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 ); }); }); @@ -3897,7 +3895,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); @@ -3908,7 +3906,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 ); }); }); @@ -3927,7 +3925,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); @@ -3938,7 +3936,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 ); }); }); @@ -3968,24 +3966,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(); @@ -4021,24 +4019,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(); }); @@ -4063,7 +4061,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"); @@ -4072,28 +4070,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 ); }); }); @@ -4117,7 +4115,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"); @@ -4126,28 +4124,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 ); }); }); @@ -4176,23 +4174,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); @@ -4223,7 +4221,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"); @@ -4239,19 +4237,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 ); }); }); @@ -4280,7 +4278,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"); @@ -4294,19 +4292,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 ); }); }); @@ -4339,7 +4337,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"); @@ -4352,16 +4350,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) ); }); }); @@ -4384,7 +4382,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); @@ -4400,7 +4398,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"); @@ -4411,7 +4409,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 ); }); }); @@ -4423,7 +4421,7 @@ describe("DataSources/KmlDataSource", function () { expect(entities.length).toEqual(2); expect(entities[0].id).toEqual("link"); expect(entities[1].parent).toBe(entities[0]); - }, + } ); }); @@ -4440,7 +4438,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); @@ -4486,7 +4484,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); @@ -4536,7 +4534,7 @@ describe("DataSources/KmlDataSource", function () { canvas: uberCanvas, camera: uberCamera, options: options, - }), + }) ).then(function (dataSource) { const entities = dataSource.entities.values; expect(entities.length).toEqual(3); @@ -4559,7 +4557,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); @@ -4586,20 +4584,18 @@ 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); @@ -4618,20 +4614,18 @@ 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); @@ -4651,26 +4645,24 @@ 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` ); }); }); @@ -4687,26 +4679,24 @@ 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` ); }); }); @@ -4723,26 +4713,24 @@ 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` ); }); }); @@ -4761,29 +4749,27 @@ 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` ); }); }); @@ -4802,20 +4788,18 @@ 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; @@ -4824,7 +4808,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` ); }); }); @@ -4842,20 +4826,18 @@ 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); @@ -4897,7 +4879,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); @@ -4920,7 +4902,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); @@ -4952,7 +4934,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"); @@ -4981,7 +4963,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"); @@ -5002,7 +4984,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 @@ -5011,7 +4993,7 @@ describe("DataSources/KmlDataSource", function () { expect(entities[0].parent).toBeUndefined(); expect(entities[2].parent).toBe(entities[0]); expect(entities[1].parent).toBe(entities[2]); - }, + } ); }); @@ -5019,7 +5001,7 @@ describe("DataSources/KmlDataSource", function () { return KmlDataSource.load("Data/KML/namespaced.kml", options).then( function (dataSource) { expect(dataSource.entities.values.length).toBe(3); - }, + } ); }); @@ -5032,7 +5014,7 @@ describe("DataSources/KmlDataSource", function () { const polylineColor = polyline.material.color.getValue(); expect(polylineColor).toEqual(expectedColor); expect(polyline.width.getValue()).toEqual(10); - }, + } ); }); @@ -5048,7 +5030,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); @@ -5067,7 +5049,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); @@ -5087,7 +5069,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"); @@ -5113,7 +5095,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]; @@ -5135,12 +5117,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" ); }); }); @@ -5159,12 +5141,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" ); }); }); @@ -5186,12 +5168,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" ); }); }); @@ -5222,21 +5204,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" ); }); }); @@ -5256,12 +5238,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" ); }); }); @@ -5288,12 +5270,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" ); }); }); @@ -5317,12 +5299,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" ); }); }); @@ -5343,12 +5325,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" ); }); }); @@ -5364,12 +5346,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" ); }); }); @@ -5392,15 +5374,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" ); }); }); @@ -5429,22 +5411,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 ); }); }); @@ -5465,12 +5447,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" ); }); }); @@ -5489,12 +5471,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" ); }); }); @@ -5519,7 +5501,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]; @@ -5572,7 +5554,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]; @@ -5617,18 +5599,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" ); }); }); @@ -5647,12 +5629,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" ); }); }); @@ -5681,7 +5663,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); }); @@ -5698,7 +5680,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); @@ -5717,7 +5699,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(); @@ -5745,7 +5727,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(); @@ -5778,7 +5760,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(); @@ -5851,13 +5833,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 b7647fd76368..da982b9920aa 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 bfb9f4b6f883..4e2c87e8f35a 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 eed297c88dba..8c712664d2cd 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 2c47034ebcd2..d256deb1825d 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 3f49259bd9f6..6c88b6e94086 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 738d0db51195..18ca6a8e558a 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,17 +207,16 @@ 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); @@ -245,7 +244,7 @@ describe( const testObject = entityCollection.getOrCreateEntity("test"); testObject.position = new ConstantPositionProperty( - Cartesian3.fromDegrees(1, 2, 3), + Cartesian3.fromDegrees(1, 2, 3) ); testObject.model = model; @@ -267,10 +266,22 @@ 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); @@ -284,12 +295,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; @@ -320,7 +331,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); @@ -344,7 +355,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); @@ -365,7 +376,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); @@ -389,7 +400,7 @@ describe( expect(state).toBe(BoundingSphereState.DONE); const expected = BoundingSphere.clone( primitive.boundingSphere, - new BoundingSphere(), + new BoundingSphere() ); expect(result).toEqual(expected); }); @@ -441,7 +452,7 @@ describe( expectedCenter.height = 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -451,7 +462,7 @@ describe( const position = Cartesian3.fromDegrees( 149.515332, -34.984799, - heightOffset, + heightOffset ); const tileset = new Cesium3DTileset({ @@ -496,7 +507,7 @@ describe( expectedCenter.height = heightOffset + 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -547,7 +558,7 @@ describe( expectedCenter.height = 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -557,7 +568,7 @@ describe( const position = Cartesian3.fromDegrees( 149.515332, -34.984799, - heightOffset, + heightOffset ); const tileset = new Cesium3DTileset({ @@ -602,7 +613,7 @@ describe( expectedCenter.height = heightOffset + 10.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -653,7 +664,7 @@ describe( expectedCenter.height = 20.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -663,7 +674,7 @@ describe( const position = Cartesian3.fromDegrees( 149.515332, -34.984799, - heightOffset, + heightOffset ); const tileset = new Cesium3DTileset({ @@ -708,7 +719,7 @@ describe( expectedCenter.height = heightOffset + 20.0; expect(result.center).toEqualEpsilon( Cartographic.toCartesian(expectedCenter), - CesiumMath.EPSILON8, + CesiumMath.EPSILON8 ); }); @@ -721,7 +732,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); @@ -745,7 +756,7 @@ describe( expect(state).toBe(BoundingSphereState.DONE); const expected = BoundingSphere.clone( primitive.boundingSphere, - new BoundingSphere(), + new BoundingSphere() ); expect(result).toEqual(expected); }); @@ -765,7 +776,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); @@ -796,5 +807,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/DataSources/NodeTransformationPropertySpec.js b/packages/engine/Specs/DataSources/NodeTransformationPropertySpec.js index f0d19cc567a4..1480f44dee7e 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 39a7b6c9adad..664fedc68a95 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 0a6c1b78e4ea..ce9ecfff2787 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 a90e9039abaf..b120f02f216b 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 657decac19a2..bdcaf48fc3b1 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 7178ecc790e6..699e801e71de 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 1f9577df23dc..6f17a7e0b033 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 8f48605dcf26..7e01741214fa 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,9 +70,17 @@ 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(); @@ -90,8 +98,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; @@ -231,7 +239,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); @@ -241,7 +249,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); @@ -334,10 +342,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); @@ -350,8 +358,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); @@ -376,7 +384,7 @@ describe( const updater = new PolygonGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection(), + new PrimitiveCollection() ); dynamicUpdater.update(time); @@ -386,12 +394,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()); @@ -446,7 +454,7 @@ describe( result = Ellipsoid.WGS84.scaleToGeodeticSurface(result, result); expect(result).toEqualEpsilon( Cartesian3.fromDegrees(0.0, 0.0), - CesiumMath.EPSILON10, + CesiumMath.EPSILON10 ); }); @@ -458,14 +466,14 @@ describe( PolygonGeometryUpdater, "polygon", createBasicPolygon, - getScene, + getScene ); createDynamicGeometryUpdaterSpecs( PolygonGeometryUpdater, "polygon", createDynamicPolygon, - getScene, + getScene ); createGeometryUpdaterGroundGeometrySpecs( @@ -473,8 +481,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 4e39288e1607..232bee6b194c 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 20e8126809a2..86cbc357d388 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 4293d01aea33..1e0b938b4d07 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 285941f48ea0..cfcbba4cdccc 100644 --- a/packages/engine/Specs/DataSources/PolylineGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/PolylineGeometryUpdaterSpec.js @@ -58,7 +58,14 @@ 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(); @@ -122,7 +129,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); @@ -130,10 +137,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); @@ -153,7 +160,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); entity.polyline.depthFailMaterial = new ColorMaterialProperty(); expect(updater.depthFailMaterialProperty).toBe( - entity.polyline.depthFailMaterial, + entity.polyline.depthFailMaterial ); }); @@ -187,7 +194,7 @@ describe( start: new JulianDate(0, 0), stop: new JulianDate(10, 0), data: ArcType.NONE, - }), + }) ); const entity = createBasicPolyline(); @@ -264,8 +271,8 @@ describe( ) { expect(attributes.depthFailColor.value).toEqual( ColorGeometryInstanceAttribute.toValue( - options.depthFailMaterial.color.getValue(time), - ), + options.depthFailMaterial.color.getValue(time) + ) ); } else { expect(attributes.depthFailColor).toBeUndefined(); @@ -275,20 +282,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 + ) ); } } @@ -425,7 +432,7 @@ describe( start: time1, stop: time2, data: false, - }), + }) ); show.intervals.addInterval( new TimeInterval({ @@ -433,7 +440,7 @@ describe( stop: time3, isStartIncluded: false, data: true, - }), + }) ); const colorMaterial = new ColorMaterialProperty(); @@ -452,11 +459,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)) ); }); @@ -468,7 +475,7 @@ describe( const instance = updater.createFillGeometryInstance(new JulianDate()); const attributes = instance.attributes; expect(attributes.show.value).toEqual( - ShowGeometryInstanceAttribute.toValue(false), + ShowGeometryInstanceAttribute.toValue(false) ); }); @@ -503,7 +510,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - scene.groundPrimitives, + scene.groundPrimitives ); expect(dynamicUpdater.isDestroyed()).toBe(false); @@ -564,7 +571,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - groundPrimitives, + groundPrimitives ); expect(dynamicUpdater.isDestroyed()).toBe(false); expect(groundPrimitives.length).toBe(0); @@ -617,7 +624,7 @@ describe( const dynamicUpdater = updater.createDynamicUpdater( primitives, - scene.groundPrimitives, + scene.groundPrimitives ); expect(dynamicUpdater.isDestroyed()).toBe(false); expect(primitives.length).toBe(0); @@ -636,7 +643,7 @@ describe( dynamicUpdater.update(time); expect(polylineObject.positions.length).not.toEqual( - geodesicPolylinePositionsLength, + geodesicPolylinePositionsLength ); dynamicUpdater.destroy(); @@ -654,7 +661,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); @@ -705,7 +712,7 @@ describe( expect(function () { return updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives, + scene.groundPrimitives ); }).toThrowDeveloperError(); updater.destroy(); @@ -742,7 +749,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives, + scene.groundPrimitives ); expect(function () { dynamicUpdater.update(undefined); @@ -771,7 +778,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives, + scene.groundPrimitives ); dynamicUpdater.update(time); @@ -802,7 +809,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives, + scene.groundPrimitives ); dynamicUpdater.update(time); @@ -835,7 +842,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives, + scene.groundPrimitives ); const result = new BoundingSphere(); @@ -855,7 +862,7 @@ describe( const updater = new PolylineGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( scene.primitives, - scene.groundPrimitives, + scene.groundPrimitives ); expect(function () { @@ -877,7 +884,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); @@ -900,7 +907,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); @@ -934,5 +941,5 @@ describe( updater.destroy(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/DataSources/PolylineGlowMaterialPropertySpec.js b/packages/engine/Specs/DataSources/PolylineGlowMaterialPropertySpec.js index a881490466bc..cbf767d89e45 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 f4db09ea9e8d..e40fb5da4101 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 0094b3fba685..10448d3890c7 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 5f4ba7b32b53..d2453021e059 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 5fc0211935d1..e2a8541580fd 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 89be9150a5f9..103036b04d6e 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 c90dff6d796a..da0af5d54ce3 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 8a3da3e739ab..8d5eb332d612 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 88f94a0d9fb2..551b4e52397c 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 75b1cce95003..bbfdfe34f0ef 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 3732e29998c8..cc95f49eccea 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 fea9d91a824b..366de65df190 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,7 +247,27 @@ 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); @@ -255,7 +275,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) ); }); @@ -285,7 +305,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) ); }); @@ -312,7 +332,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) ); }); @@ -322,7 +342,7 @@ describe("DataSources/SampledPositionProperty", function () { property.addSample( new JulianDate(0, 0), new Cartesian3(7, 8, 9), - undefined, + undefined ); }).toThrowDeveloperError(); }); @@ -415,7 +435,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); @@ -430,7 +450,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 3caa5d99fe6c..8f98ee275074 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,15 +601,51 @@ 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, ], }, ]; @@ -622,14 +658,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); @@ -723,9 +759,16 @@ 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]); @@ -739,17 +782,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 ); } }); @@ -850,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 ); } }); @@ -873,11 +916,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 ); } }); @@ -893,11 +936,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 ); } }); @@ -913,11 +956,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 ); } }); @@ -940,11 +983,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 ); } }); @@ -966,11 +1009,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 1f543e7307f4..379410a2a3b8 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 de2af7f170fa..ea0933a13dfd 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 7fcd76449690..24711775a350 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 f491e0752398..6f7ceb39ab53 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 e3e05bc22f1b..32ade306d4fd 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 a71a1e04c255..3af4d26484ab 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 94bdb5505fb0..8d1f055a853b 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 8a444e67b524..880d682978f7 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 b5d3687b3fc7..ca98185ffac1 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 ef7951711f3a..75228c1d99d7 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 4e059ecad6d0..c9d59660e9cc 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 dd4249ea0956..28b8261e334e 100644 --- a/packages/engine/Specs/DataSources/WallGeometryUpdaterSpec.js +++ b/packages/engine/Specs/DataSources/WallGeometryUpdaterSpec.js @@ -40,9 +40,7 @@ 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; @@ -81,7 +79,7 @@ describe( start: time, stop: time2, data: [], - }), + }) ); updater._onEntityPropertyChanged(entity, "wall"); @@ -97,7 +95,7 @@ describe( start: time, stop: time2, data: [], - }), + }) ); updater._onEntityPropertyChanged(entity, "wall"); @@ -149,7 +147,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]); @@ -165,7 +163,7 @@ describe( const updater = new WallGeometryUpdater(entity, scene); const dynamicUpdater = updater.createDynamicUpdater( new PrimitiveCollection(), - new PrimitiveCollection(), + new PrimitiveCollection() ); dynamicUpdater.update(time); @@ -217,15 +215,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 78432a7c0615..52856fef58ce 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 f6bfc44557fe..61c40af56152 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 b994a15a43af..f6381a39f9ef 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 9f96253ebf0e..666cdd8e3b1f 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 0f71d8f7b20d..c4457c832e13 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 2a6454ab8b3c..4d2744841050 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 51d001526e74..34dc9ec90312 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 17a28952b240..7cb308cbcb8f 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 86a97c7c28a8..4c7ac6ccfeac 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 3d7ab36a6c02..ea4a508eddc1 100644 --- a/packages/engine/Specs/Renderer/DrawSpec.js +++ b/packages/engine/Specs/Renderer/DrawSpec.js @@ -584,8 +584,22 @@ 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, }), @@ -649,8 +663,22 @@ 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, }), @@ -716,8 +744,22 @@ 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, }), @@ -828,7 +870,14 @@ 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, }), @@ -994,8 +1043,22 @@ 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, }), @@ -1085,8 +1148,22 @@ 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, }), @@ -1462,5 +1539,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Renderer/FramebufferManagerSpec.js b/packages/engine/Specs/Renderer/FramebufferManagerSpec.js index de1d797048eb..12ddd6966f4d 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 a963018ac362..bcfac7f68c22 100644 --- a/packages/engine/Specs/Renderer/FramebufferSpec.js +++ b/packages/engine/Specs/Renderer/FramebufferSpec.js @@ -292,11 +292,12 @@ 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 () { @@ -315,11 +316,12 @@ 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 () { @@ -338,11 +340,12 @@ 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) { @@ -453,7 +456,7 @@ describe( if (framebuffer.status === WebGLConstants.FRAMEBUFFER_COMPLETE) { expect( - renderDepthAttachment(framebuffer, framebuffer.depthTexture), + renderDepthAttachment(framebuffer, framebuffer.depthTexture) ).toEqualEpsilon([128, 128, 128, 255], 1); } } @@ -481,7 +484,7 @@ describe( if (framebuffer.status === WebGLConstants.FRAMEBUFFER_COMPLETE) { expect( - renderDepthAttachment(framebuffer, framebuffer.depthStencilTexture), + renderDepthAttachment(framebuffer, framebuffer.depthStencilTexture) ).toEqualEpsilon([128, 128, 128, 255], 1); } } @@ -738,7 +741,7 @@ describe( }), }); expect(framebuffer.status).not.toEqual( - WebGLConstants.FRAMEBUFFER_COMPLETE, + WebGLConstants.FRAMEBUFFER_COMPLETE ); }); @@ -925,7 +928,7 @@ describe( return new Framebuffer({ context: context, colorRenderbuffers: new Array( - ContextLimits.maximumColorAttachments + 1, + ContextLimits.maximumColorAttachments + 1 ), }); }).toThrowDeveloperError(); @@ -962,7 +965,7 @@ describe( expect(function () { framebuffer.getColorRenderbuffer( - ContextLimits.maximumColorAttachments + 1, + ContextLimits.maximumColorAttachments + 1 ); }).toThrowDeveloperError(); }); @@ -1022,5 +1025,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Renderer/MultisampleFramebufferSpec.js b/packages/engine/Specs/Renderer/MultisampleFramebufferSpec.js index 7393c123b173..faf90872bbe0 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 afa5d42d1d41..4e757d3df986 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 105a1768dbe0..83c001360641 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 7ae117336e27..dc5ffaf741a4 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 9e9fe00e91fb..8f83492a9fd1 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 0636a743e4c9..3a71abfea11d 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 bb723aebd27e..b517d117eb15 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 9d57cc1346de..d40ad7c34a05 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 2645b15f5839..8a63340b072e 100644 --- a/packages/engine/Specs/Renderer/ShaderSourceSpec.js +++ b/packages/engine/Specs/Renderer/ShaderSourceSpec.js @@ -5,8 +5,7 @@ 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({ @@ -109,7 +108,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); }" ); }); @@ -133,7 +132,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 e116b448f8f0..162ae79b6118 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 609a6a95da47..d4381eab941e 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; - }), + }) ); } @@ -154,7 +154,7 @@ describe( expect(texture.sizeInBytes).toEqual( expectedWidth * expectedHeight * - PixelFormat.componentsLength(texture.pixelFormat), + PixelFormat.componentsLength(texture.pixelFormat) ); command.color = Color.WHITE; @@ -198,7 +198,7 @@ describe( expect(texture.sizeInBytes).toEqual( expectedWidth * expectedHeight * - PixelFormat.componentsLength(texture.pixelFormat), + PixelFormat.componentsLength(texture.pixelFormat) ); // Clear to white @@ -232,41 +232,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 () { @@ -399,7 +399,14 @@ 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({ @@ -776,7 +783,7 @@ describe( texture.generateMipmap(); expect(texture.sizeInBytes).toEqualEpsilon( (16 * 16 + 8 * 8 + 4 * 4 + 2 * 2 + 1) * 4, - 1, + 1 ); expect({ @@ -869,7 +876,7 @@ describe( height, pixelFormat, pixelDatatype, - expectedSize, + expectedSize ) { texture = new Texture({ context: context, @@ -890,21 +897,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 ); } @@ -914,35 +921,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 ); }); @@ -1555,5 +1562,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Renderer/UniformSpec.js b/packages/engine/Specs/Renderer/UniformSpec.js index aee94f158bae..a783e1a0bb38 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 56e7f6fec589..4600ed72f465 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 579e735dd04b..d0042e076c39 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,8 +338,9 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = - GeometryPipeline.createAttributeLocations(geometry); + const attributeLocations = GeometryPipeline.createAttributeLocations( + geometry + ); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -408,8 +409,9 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = - GeometryPipeline.createAttributeLocations(geometry); + const attributeLocations = GeometryPipeline.createAttributeLocations( + geometry + ); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -492,8 +494,9 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = - GeometryPipeline.createAttributeLocations(geometry); + const attributeLocations = GeometryPipeline.createAttributeLocations( + geometry + ); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -568,8 +571,9 @@ describe( primitiveType: PrimitiveType.POINTS, }); - const attributeLocations = - GeometryPipeline.createAttributeLocations(geometry); + const attributeLocations = GeometryPipeline.createAttributeLocations( + geometry + ); const va = VertexArray.fromGeometry({ context: context, geometry: geometry, @@ -672,7 +676,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); }); @@ -732,5 +736,5 @@ describe( }).toThrowDeveloperError(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Renderer/VertexArraySpec.js b/packages/engine/Specs/Renderer/VertexArraySpec.js index bfc5834735e5..f9dd7f36f8dc 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 70ee6f6ad8cd..de41c7154dfa 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 43fb29cabc60..05cd5876c728 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 94000fee5b82..61705dc67bfb 100644 --- a/packages/engine/Specs/Scene/ArcGisMapServerImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/ArcGisMapServerImageryProviderSpec.js @@ -46,24 +46,22 @@ 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 ); }); @@ -102,9 +100,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" ); }); @@ -136,10 +134,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/" ); }); @@ -182,10 +180,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." ); }); @@ -237,10 +235,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." ); }); @@ -256,7 +254,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); @@ -265,15 +263,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"); }); @@ -284,7 +282,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { ArcGisBaseMapType.SATELLITE, { token: "myToken", - }, + } ); expect(provider.url).toContain(expectedUrl); @@ -297,16 +295,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" ); }); @@ -325,7 +323,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); @@ -334,14 +332,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`)); @@ -350,7 +348,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred, + deferred ); } }; @@ -362,7 +360,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -373,7 +371,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { method, data, headers, - deferred, + deferred ); }; @@ -430,7 +428,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); @@ -438,7 +436,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred, + deferred ) { const url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -449,7 +447,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { deferred, true, false, - true, + true ); } else { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -458,7 +456,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred, + deferred ); } }; @@ -470,7 +468,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toEqual(getAbsoluteUri(`${baseUrl}tile/0/0/0`)); @@ -481,7 +479,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { method, data, headers, - deferred, + deferred ); }; @@ -502,7 +500,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); @@ -533,7 +531,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred, + deferred ) { const uri = new Uri(request.url); const params = queryToObject(uri.query()); @@ -542,7 +540,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { uriWithoutQuery.query(""); expect(uriWithoutQuery.toString()).toEqual( - getAbsoluteUri(`${baseUrl}export`), + getAbsoluteUri(`${baseUrl}export`) ); expect(params.f).toEqual("image"); @@ -556,7 +554,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred, + deferred ); }; @@ -596,7 +594,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { copyrightText: "Test copyright text", }, undefined, - token, + token ); const provider = await ArcGisMapServerImageryProvider.fromUrl(baseUrl, { @@ -618,7 +616,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); @@ -627,7 +625,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred, + deferred ) { const uri = new Uri(request.url); const params = queryToObject(uri.query()); @@ -636,7 +634,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { uriWithoutQuery.query(""); expect(uriWithoutQuery.toString()).toEqual( - getAbsoluteUri(`${baseUrl}export`), + getAbsoluteUri(`${baseUrl}export`) ); expect(params.f).toEqual("image"); @@ -652,7 +650,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred, + deferred ); }; @@ -674,7 +672,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { const expectedTileUrl = getAbsoluteUri( `${baseUrl}tile/0/0/0?${objectToQuery({ token: token, - })}`, + })}` ); expect(provider.url).toEqual(baseUrl); @@ -686,7 +684,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); @@ -695,7 +693,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._Implementations.createImage = function ( request, crossOrigin, - deferred, + deferred ) { const url = request.url; if (/^blob:/.test(url) || supportsImageBitmapOptions) { @@ -706,7 +704,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { deferred, true, false, - true, + true ); } else { expect(url).toEqual(expectedTileUrl); @@ -715,7 +713,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { Resource._DefaultImplementations.createImage( new Request({ url: "Data/Images/Red16x16.png" }), crossOrigin, - deferred, + deferred ); } }; @@ -727,7 +725,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toEqual(expectedTileUrl); @@ -738,7 +736,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { method, data, headers, - deferred, + deferred ); }; @@ -799,16 +797,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); }); @@ -867,10 +865,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 ); }); @@ -925,7 +923,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) ); }); @@ -977,10 +975,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." ); }); @@ -991,7 +989,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { "made/up/map/server", { usePreCachedTilesIfAvailable: false, - }, + } ); Resource._Implementations.loadWithXhr = function ( @@ -1001,7 +999,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("identify"); Resource._DefaultImplementations.loadWithXhr( @@ -1011,7 +1009,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1023,8 +1021,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) + ) ); }); @@ -1034,7 +1032,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { "made/up/map/server", { usePreCachedTilesIfAvailable: false, - }, + } ); Resource._Implementations.loadWithXhr = function ( @@ -1044,7 +1042,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("identify"); Resource._DefaultImplementations.loadWithXhr( @@ -1054,7 +1052,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; return provider @@ -1066,7 +1064,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) ); }); }); @@ -1078,7 +1076,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, enablePickFeatures: false, - }, + } ); expect(provider.pickFeatures(0, 0, 0, 0.5, 0.5)).toBeUndefined(); @@ -1091,7 +1089,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, enablePickFeatures: true, - }, + } ); provider.enablePickFeatures = false; @@ -1105,7 +1103,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { { usePreCachedTilesIfAvailable: false, enablePickFeatures: false, - }, + } ); provider.enablePickFeatures = true; @@ -1117,7 +1115,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("identify"); Resource._DefaultImplementations.loadWithXhr( @@ -1127,7 +1125,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1144,7 +1142,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { const uri = new Uri(url); const query = queryToObject(uri.query()); @@ -1157,7 +1155,7 @@ describe("Scene/ArcGisMapServerImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1166,7 +1164,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 f442bf0bcc98..8055b2e8554e 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 5064e26a594c..f01d807ed0f4 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 47ca7363d9ca..b2b6c074256f 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 582e06e72873..1fdab934e6bf 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 a2ad34141e3a..ea765487e13c 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 c4524980fd3b..004580aebdf1 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 fb509661180d..5d1b2791bc85 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 3323376afa7d..8417fdd1e640 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 23858656f5f1..011b404611e9 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,17 +236,16 @@ 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(); }); @@ -259,11 +258,10 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }, }); - const boundingVolume = - BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "TILE", - tileMetadata, - ); + const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "TILE", + tileMetadata + ); expect(boundingVolume).toEqual({ box: boundingBox, }); @@ -278,11 +276,10 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }, }); - const boundingVolume = - BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "CONTENT", - tileMetadata, - ); + const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "CONTENT", + tileMetadata + ); expect(boundingVolume).toEqual({ region: boundingRegion, }); @@ -297,11 +294,10 @@ describe("Scene/BoundingVolumeSemantics", function () { }, }, }); - const boundingVolume = - BoundingVolumeSemantics.parseBoundingVolumeSemantic( - "TILE", - tileMetadata, - ); + const boundingVolume = BoundingVolumeSemantics.parseBoundingVolumeSemantic( + "TILE", + tileMetadata + ); expect(boundingVolume).toEqual({ sphere: boundingSphere, }); @@ -322,7 +318,7 @@ describe("Scene/BoundingVolumeSemantics", function () { // Box is handled before region const box = BoundingVolumeSemantics.parseBoundingVolumeSemantic( "TILE", - tileMetadata, + tileMetadata ); expect(box).toEqual({ box: boundingBox, @@ -331,7 +327,7 @@ describe("Scene/BoundingVolumeSemantics", function () { // region is handled before sphere const region = BoundingVolumeSemantics.parseBoundingVolumeSemantic( "CONTENT", - tileMetadata, + tileMetadata ); expect(region).toEqual({ region: boundingRegion, @@ -344,7 +340,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMinimumHeight( undefined, - emptyMetadata, + emptyMetadata ); }).toThrowDeveloperError(); }); @@ -353,7 +349,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMinimumHeight( "TILESET", - emptyMetadata, + emptyMetadata ); }).toThrowDeveloperError(); }); @@ -367,7 +363,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(); }); @@ -383,7 +379,7 @@ describe("Scene/BoundingVolumeSemantics", function () { }); const height = BoundingVolumeSemantics._parseMinimumHeight( "TILE", - tileMetadata, + tileMetadata ); expect(height).toBe(minimumHeight); }); @@ -394,7 +390,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMaximumHeight( undefined, - emptyMetadata, + emptyMetadata ); }).toThrowDeveloperError(); }); @@ -403,7 +399,7 @@ describe("Scene/BoundingVolumeSemantics", function () { expect(function () { return BoundingVolumeSemantics._parseMaximumHeight( "TILESET", - emptyMetadata, + emptyMetadata ); }).toThrowDeveloperError(); }); @@ -417,7 +413,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(); }); @@ -433,7 +429,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 27cefe64bd94..c7b42a761a96 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 0dc2ac5f9409..884ab8e001e9 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 c418e12ef174..364c3b31e536 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 b4cd134bf356..a4573e7688ea 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 c56dccef6e45..6f90f345f173 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 04b4f5370fc5..c892ab3bdd64 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,17 +464,78 @@ 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 = [ @@ -529,24 +590,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( @@ -565,8 +626,8 @@ xdescribe( 65, 69, 73, - 77, - ), + 77 + ) ); // Constructor is row-major, data is column major batchTable.setProperty(1, "propertyScalar", 2); @@ -577,7 +638,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, @@ -598,25 +659,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( @@ -635,8 +696,8 @@ xdescribe( 66, 70, 74, - 78, - ), + 78 + ) ); }); @@ -663,7 +724,7 @@ xdescribe( }); Cesium3DTilesTester.expectRenderTileset(scene, tileset); - }, + } ); }); @@ -675,7 +736,7 @@ xdescribe( expect(content.getFeature(2).getProperty("id")).toBeUndefined(); Cesium3DTilesTester.expectRenderTileset(scene, tileset); - }, + } ); }); @@ -690,9 +751,8 @@ xdescribe( Cesium3DTilesTester.expectRenderTileset(scene, tileset); // Re-enable VTF - ContextLimits._maximumVertexTextureImageUnits = - maximumVertexTextureImageUnits; - }, + ContextLimits._maximumVertexTextureImageUnits = maximumVertexTextureImageUnits; + } ); }); @@ -705,13 +765,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; - }, + } ); }); @@ -724,7 +784,7 @@ xdescribe( expect(result).toBeDefined(); expect(result.primitive).toBe(tileset); }); - }, + } ); }); @@ -762,7 +822,7 @@ xdescribe( return Cesium3DTilesTester.loadTileset(scene, withoutBatchTableUrl).then( function (tileset) { expectRenderTranslucent(tileset); - }, + } ); }); @@ -775,9 +835,8 @@ xdescribe( function (tileset) { expectRenderTranslucent(tileset); // Re-enable VTF - ContextLimits._maximumVertexTextureImageUnits = - maximumVertexTextureImageUnits; - }, + ContextLimits._maximumVertexTextureImageUnits = maximumVertexTextureImageUnits; + } ); }); @@ -1054,21 +1113,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 () { @@ -1082,7 +1141,7 @@ xdescribe( it("renders tileset with batch table hierarchy with multiple parent classes", function () { return checkBatchTableHierarchy( batchTableHierarchyMultipleParentsUrl, - true, + true ); }); @@ -1098,7 +1157,7 @@ xdescribe( return checkBatchTableHierarchy(batchTableHierarchyLegacyUrl, false).then( function (tileset) { expect(Cesium3DTileBatchTable._deprecationWarning).toHaveBeenCalled(); - }, + } ); }); @@ -1113,7 +1172,7 @@ xdescribe( scene.pickForSpecs(); const batchTextureSize = batchTable._batchTexture.byteLength; expect(batchTable.batchTableByteLength).toBe(batchTextureSize); - }, + } ); }); @@ -1128,28 +1187,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 ); }); }); @@ -1157,7 +1216,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; @@ -1168,7 +1227,7 @@ xdescribe( scene.pickForSpecs(); const batchTextureSize = batchTable._batchTexture.byteLength; expect(batchTable.batchTableByteLength).toBe( - hierarchySize + batchTextureSize, + hierarchySize + batchTextureSize ); }); }); @@ -1181,9 +1240,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 2f45ed8cf0d3..aca4a2fe7a86 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 cb814fb32fc9..20bf100afb6e 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 48f036cef4d8..cb5270986461 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,20 +594,28 @@ 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; @@ -617,15 +625,23 @@ 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 ); }); @@ -634,24 +650,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; @@ -661,19 +677,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 ); }); @@ -682,24 +698,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); @@ -710,11 +726,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); }); @@ -736,10 +752,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(); @@ -750,10 +766,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(); @@ -764,10 +780,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(); @@ -778,10 +794,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(); @@ -793,7 +809,7 @@ describe( mockTileset, "/some_url", tileWithBoundingSphere, - undefined, + undefined ); tile1._priorityHolder = tile1; tile1._foveatedFactor = 0.0; @@ -805,7 +821,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 @@ -834,15 +850,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 @@ -864,7 +880,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); @@ -873,7 +889,7 @@ describe( mockTilesetScaled, "/some_url", header, - undefined, + undefined ); expect(tile._geometricError).toBe(1); @@ -882,5 +898,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 d762d34bfbad..957d4d261457 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 49f5ff44fdbc..214de3d8d101 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 ceb616fb9c1d..3c4782ee83c0 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 57815219fe30..eb34b52e2cde 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 bf41868f39dd..364c9369df1a 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 414a52880562..bb1418cebfcf 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 1377623b5161..0419ed73eb27 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 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 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,38 +869,37 @@ 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); @@ -908,40 +907,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 @@ -950,11 +949,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 () { @@ -977,7 +976,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. @@ -988,75 +987,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) { @@ -1074,32 +1073,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(); + 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"); - - 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) { @@ -1167,7 +1166,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, withTransformBoxUrl, - options, + options ); // Make sure the values match the constructor, not hard-coded defaults @@ -1191,50 +1190,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 @@ -1255,58 +1254,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 () { @@ -1315,7 +1314,7 @@ describe( tilesetWithViewerRequestVolumeUrl, { skipLevelOfDetail: false, - }, + } ).then(function (tileset) { const statistics = tileset._statistics; @@ -1349,7 +1348,7 @@ describe( viewRootOnly(); return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement1Url, + tilesetReplacement1Url ).then(function (tileset) { tileset.skipLevelOfDetail = false; viewAllTiles(); @@ -1366,7 +1365,7 @@ describe( function () { scene.renderForSpecs(); expect(statistics.numberOfCommands).toEqual(4); // Render children - }, + } ); }); }); @@ -1383,7 +1382,7 @@ describe( viewRootOnly(); return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement2Url, + tilesetReplacement2Url ).then(function (tileset) { tileset.skipLevelOfDetail = false; const statistics = tileset._statistics; @@ -1397,9 +1396,9 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( function () { expect(statistics.numberOfCommands).toEqual(2); // Renders two content tiles - }, + } ); - }, + } ); }); }); @@ -1416,7 +1415,7 @@ describe( viewRootOnly(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement3Url, + tilesetReplacement3Url ); tileset.skipLevelOfDetail = false; const statistics = tileset._statistics; @@ -1456,14 +1455,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 () { @@ -1476,7 +1475,7 @@ describe( const statistics = tileset._statistics; expect(statistics.visited).toEqual(7); expect(statistics.numberOfCommands).toEqual(6); - }, + } ); }); @@ -1484,12 +1483,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)); @@ -1501,33 +1500,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); @@ -1538,12 +1537,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; @@ -1556,7 +1555,7 @@ describe( expect(root._visible).toBe(false); expect(externalRoot._visible).toBe(false); expect(tileset.statistics.numberOfTilesCulledWithChildrenUnion).toBe( - 1, + 1 ); }); }); @@ -1564,7 +1563,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]; @@ -1575,33 +1574,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); @@ -1611,7 +1610,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]; @@ -1624,37 +1623,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); - }, + } ); }); }); @@ -1666,7 +1665,7 @@ describe( tilesetReplacementWithViewerRequestVolumeUrl, { cullWithChildrenBounds: false, - }, + } ).then(function (tileset) { const root = tileset.root; const childRoot = root.children[0]; @@ -1674,33 +1673,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); @@ -1711,7 +1710,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]; @@ -1723,33 +1722,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); @@ -1759,7 +1758,7 @@ describe( scene.renderForSpecs(); expect(tileset._selectedTiles.length).toEqual(4); expect(isSelected(tileset, childRoot)).toBe(false); - }, + } ); }); }); @@ -1771,7 +1770,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; @@ -1794,7 +1793,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 @@ -1813,11 +1812,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(); @@ -1832,10 +1831,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 ); }); @@ -1845,7 +1844,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 - }, + } ); }); @@ -1856,7 +1855,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 - }, + } ); }); @@ -1874,50 +1873,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 () { @@ -1981,43 +1980,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(); @@ -2033,42 +2032,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(); @@ -2077,10 +2076,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; @@ -2093,7 +2092,7 @@ describe( // tilesetWithViewerRequestVolumeUrl has bounding sphere return Cesium3DTilesTester.loadTileset( scene, - tilesetWithViewerRequestVolumeUrl, + tilesetWithViewerRequestVolumeUrl ).then(function (tileset) { tileset.debugShowGeometricError = true; scene.renderForSpecs(); @@ -2104,7 +2103,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}` ); } @@ -2116,133 +2115,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 () { @@ -2298,18 +2297,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 () { @@ -2334,66 +2333,63 @@ describe( await Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); viewAllTiles(); - await Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - expect(spyUpdate1.calls.count()).toEqual(2); - 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); - }, - ); + await Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); + expect(spyUpdate1.calls.count()).toEqual(2); + 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 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 () { @@ -2409,10 +2405,10 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ) { deferred.reject("404"); - }, + } ); tileset.tileFailed.addEventListener(spyUpdate); tileset.cacheBytes = 0; @@ -2439,18 +2435,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 ); }); @@ -2460,7 +2456,7 @@ describe( tilesetOfTilesetsUrl, { enablePick: !scene.frameState.context.webgl2, - }, + } ); viewRootOnly(); scene.renderForSpecs(); @@ -2468,18 +2464,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 ); }); @@ -2489,7 +2485,7 @@ describe( instancedUrl, { enablePick: !scene.frameState.context.webgl2, - }, + } ); viewInstances(); scene.renderForSpecs(); @@ -2497,18 +2493,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 ); }); @@ -2518,7 +2514,7 @@ describe( translucentUrl, { enablePick: !scene.frameState.context.webgl2, - }, + } ); viewAllTiles(); scene.renderForSpecs(); @@ -2526,18 +2522,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 ); }); @@ -2547,7 +2543,7 @@ describe( tilesetWithTransformsUrl, { enablePick: !scene.frameState.context.webgl2, - }, + } ); viewAllTiles(); scene.renderForSpecs(); @@ -2555,18 +2551,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 ); }); @@ -2576,7 +2572,7 @@ describe( pointCloudUrl, { enablePick: !scene.frameState.context.webgl2, - }, + } ); viewAllTiles(); scene.renderForSpecs(); @@ -2584,8 +2580,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(); @@ -2600,7 +2596,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); @@ -2616,35 +2612,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; @@ -2695,7 +2691,7 @@ describe( ibl.imageBasedLightingFactor = new Cartesian2(0.0, 0.0); expect(renderOptions).notToRender(rgba); }); - }, + } ); }); @@ -2716,7 +2712,7 @@ describe( expect(renderOptions).notToRender(rgba2); }); }); - }, + } ); }); @@ -2725,23 +2721,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 () { @@ -2749,12 +2745,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, }; @@ -2767,12 +2763,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, }; @@ -2785,12 +2781,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, }; @@ -2803,12 +2799,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, }; @@ -2830,7 +2826,7 @@ describe( expect(scene).toRender([0, 0, 0, 255]); tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -2847,7 +2843,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -2864,7 +2860,7 @@ describe( // ${id} < 10 will always evaluate to true tileset.style = new Cesium3DTileStyle({ show: "${id} < 200 / 2" }); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -2878,7 +2874,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -2896,7 +2892,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -2914,7 +2910,7 @@ describe( tileset.style = new Cesium3DTileStyle({ show: "true" }); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -2955,7 +2951,7 @@ describe( return Cesium3DTilesTester.loadTileset(scene, withoutBatchTableUrl).then( function (tileset) { return expectColorStyle(tileset); - }, + } ); }); @@ -2963,14 +2959,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); }); @@ -2980,7 +2976,7 @@ describe( return Cesium3DTilesTester.loadTileset(scene, noBatchIdsUrl).then( function (tileset) { return expectColorStyle(tileset); - }, + } ); }); @@ -2989,7 +2985,7 @@ describe( function (tileset) { viewGltfContent(); return expectColorStyle(tileset); - }, + } ); }); @@ -2998,7 +2994,7 @@ describe( function (tileset) { viewGltfContent(); return expectColorStyle(tileset); - }, + } ); }); @@ -3028,7 +3024,7 @@ describe( feature.setProperty("id", feature.getProperty("id") - 10); } expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -3065,7 +3061,7 @@ describe( expect(feature.show).toBe(false); viewAllTiles(); expect(feature.show).toBe(false); - }, + } ); }); @@ -3078,14 +3074,14 @@ describe( scene.renderForSpecs(); expect( tileset._statisticsPerPass[Cesium3DTilePass.RENDER] - .numberOfTilesStyled, + .numberOfTilesStyled ).toBe(1); scene.pickForSpecs(); expect( tileset._statisticsPerPass[Cesium3DTilePass.PICK] - .numberOfTilesStyled, + .numberOfTilesStyled ).toBe(0); - }, + } ); }); @@ -3116,7 +3112,7 @@ describe( expect(rgba[2]).toEqual(0); expect(rgba[3]).toEqual(255); }); - }, + } ); }); @@ -3156,7 +3152,7 @@ describe( expect(rgba[2]).toBeGreaterThan(0); expect(rgba[3]).toEqual(255); }); - }, + } ); }); @@ -3173,7 +3169,7 @@ describe( scene.renderForSpecs(); expect(tileset.root.content.getFeature(0).color).toEqual(Color.WHITE); expect(tileset.root.content.getFeature(1).color).toEqual(Color.BLACK); - }, + } ); }); @@ -3199,7 +3195,7 @@ describe( scene.renderForSpecs(); expect(tileset.root.content.getFeature(0).show).toBe(true); expect(tileset.root.content.getFeature(1).show).toBe(false); - }, + } ); }); @@ -3216,7 +3212,7 @@ describe( expect(rgba[3]).toEqual(255); }); }); - }, + } ); }); @@ -3243,7 +3239,7 @@ describe( style.show._value = true; tileset.makeStyleDirty(); expect(scene).notToRender([0, 0, 0, 255]); - }, + } ); }); @@ -3270,7 +3266,7 @@ describe( expect(rgba[2]).toBe(0); expect(rgba[3]).toEqual(255); }); - }, + } ); }); @@ -3291,7 +3287,7 @@ describe( scene.renderForSpecs(); expect(statistics.numberOfTilesStyled).toBe(0); - }, + } ); }); @@ -3313,7 +3309,7 @@ describe( tileset.style = style; scene.renderForSpecs(); expect(statistics.numberOfTilesStyled).toBe(0); - }, + } ); }); @@ -3504,8 +3500,7 @@ describe( ContextLimits._maximumVertexTextureImageUnits = 0; return testColorBlendMode(colorsUrl).then(function () { // Re-enable VTF - ContextLimits._maximumVertexTextureImageUnits = - maximumVertexTextureImageUnits; + ContextLimits._maximumVertexTextureImageUnits = maximumVertexTextureImageUnits; }); }); @@ -3526,136 +3521,134 @@ 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 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); - // Zoom back in and attempt to render all tiles - viewAllTiles(); + // 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, - ); - }, - ); - }, - ); + 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 () { @@ -3689,9 +3682,9 @@ describe( expect(statistics.numberOfTilesWithContentReady).toEqual(5); expect(cacheList.length - 1).toEqual(5); - }, + } ); - }, + } ); }); @@ -3720,9 +3713,9 @@ describe( function () { expect(statistics.numberOfCommands).toEqual(4); expect(statistics.numberOfTilesWithContentReady).toEqual(4); - }, + } ); - }, + } ); }); @@ -3735,7 +3728,7 @@ describe( // return Cesium3DTilesTester.loadTileset( scene, - tilesetReplacement1Url, + tilesetReplacement1Url ).then(function (tileset) { tileset.cacheBytes = 0; // Only root needs to be visible @@ -3762,74 +3755,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 () { @@ -3861,7 +3854,7 @@ describe( const totalCommands = b3dmCommands + i3dmCommands; return Cesium3DTilesTester.loadTileset( scene, - tilesetWithTransformsUrl, + tilesetWithTransformsUrl ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -3872,7 +3865,7 @@ describe( let computedTransform = Matrix4.multiply( rootTransform, childTransform, - new Matrix4(), + new Matrix4() ); expect(statistics.numberOfCommands).toBe(totalCommands); @@ -3881,20 +3874,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); @@ -3906,7 +3899,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); @@ -3925,7 +3918,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetUrl, - skipLevelOfDetailOptions, + skipLevelOfDetailOptions ).then(function (tileset) { viewAllTiles(); scene.renderForSpecs(); @@ -3938,7 +3931,7 @@ describe( function (tileset) { expect(statistics.numberOfTilesWithContentReady).toEqual(5); expect(tileset.hasMixedContent).toBe(false); - }, + } ); }); }); @@ -3947,7 +3940,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions, + skipLevelOfDetailOptions ).then(function (tileset) { const statistics = tileset._statistics; @@ -3961,7 +3954,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); @@ -3969,7 +3962,7 @@ describe( function (tileset) { expect(statistics.numberOfTilesWithContentReady).toEqual(5); expect(tileset.hasMixedContent).toBe(false); - }, + } ); }); }); @@ -3978,7 +3971,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(); @@ -3997,7 +3990,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions, + skipLevelOfDetailOptions ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -4014,10 +4007,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); @@ -4035,7 +4028,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetReplacement3Url, - skipLevelOfDetailOptions, + skipLevelOfDetailOptions ).then(function (tileset) { const statistics = tileset._statistics; const root = tileset.root; @@ -4052,16 +4045,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); @@ -4085,11 +4078,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; @@ -4116,7 +4109,7 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( function (tileset) { expect(statistics.numberOfTilesWithContentReady).toBe(5); - }, + } ); }); }); @@ -4146,9 +4139,9 @@ describe( function (tileset) { expect(!isSelected(tileset, child)); expect(isSelected(tileset, root)); - }, + } ); - }, + } ); }); }); @@ -4157,7 +4150,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, tilesetOfTilesetsUrl, - skipLevelOfDetailOptions, + skipLevelOfDetailOptions ).then(function (tileset) { const statistics = tileset._statistics; const parent = tileset.root.children[0]; @@ -4188,7 +4181,7 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( batchedColorsB3dmUrl, @@ -4197,9 +4190,9 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ); - }, + } ); const tile = tileset.root; const statistics = tileset._statistics; @@ -4211,10 +4204,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); @@ -4230,7 +4223,7 @@ describe( tile.expireDate = JulianDate.addSeconds( JulianDate.now(), -1.0, - new JulianDate(), + new JulianDate() ); // Stays in the expired state until the request goes through @@ -4256,8 +4249,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 @@ -4281,7 +4274,7 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); }); - }, + } ); }); @@ -4296,35 +4289,33 @@ 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, + spyOn(Resource._Implementations, "loadWithXhr").and.callFake(function ( + url, + responseType, + method, + data, + headers, + deferred, + overrideMimeType + ) { + const newDeferred = defer(); + Resource._DefaultImplementations.loadWithXhr( + tilesetSubtreeUrl, responseType, method, data, headers, - deferred, - overrideMimeType, - ) { - const newDeferred = defer(); - Resource._DefaultImplementations.loadWithXhr( - tilesetSubtreeUrl, - responseType, - method, - data, - headers, - newDeferred, - overrideMimeType, - ); - newDeferred.promise.then(function (arrayBuffer) { - deferred.resolve(modifySubtreeBuffer(arrayBuffer)); - }); - }, - ); + newDeferred, + overrideMimeType + ); + newDeferred.promise.then(function (arrayBuffer) { + deferred.resolve(modifySubtreeBuffer(arrayBuffer)); + }); + }); const subtreeRoot = tileset.root.children[0]; const subtreeChildren = subtreeRoot.children[0].children; @@ -4340,7 +4331,7 @@ describe( subtreeRoot.expireDate = JulianDate.addSeconds( JulianDate.now(), -1.0, - new JulianDate(), + new JulianDate() ); // Listen to tile unload events @@ -4376,7 +4367,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")); @@ -4388,7 +4379,7 @@ describe( tile.expireDate = JulianDate.addSeconds( JulianDate.now(), -1.0, - new JulianDate(), + new JulianDate() ); const failedSpy = jasmine.createSpy("listenerSpy"); @@ -4405,48 +4396,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); @@ -4455,25 +4446,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 () { @@ -4495,110 +4486,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; @@ -4648,7 +4639,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( @@ -4657,23 +4648,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); - }, + } ); - }, + } ); }); @@ -4682,41 +4673,48 @@ 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; @@ -4727,7 +4725,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], @@ -4749,12 +4747,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({ @@ -4774,7 +4772,7 @@ describe( const tileset = await Cesium3DTilesTester.loadTileset( scene, - tilesetUrl, + tilesetUrl ); let visibility = tileset.root.contentVisibility(scene.frameState); @@ -4799,13 +4797,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 () { @@ -4815,7 +4813,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 @@ -4830,7 +4828,7 @@ describe( expect(tileset.statistics.selected).toBe(0); tileset.updateForPass(scene.frameState, preloadFlightPassState); expect(tileset._requestedTiles.length).toBe(5); - }, + } ); }); @@ -4848,7 +4846,7 @@ describe( function (tileset) { tileset.updateForPass(scene.frameState, renderPassState); expect(passCommandList.length).toBe(5); - }, + } ); }); @@ -4917,7 +4915,7 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, 0.6988740001506679, - 2.4683731133709323, + 2.4683731133709323 ); const cartographics = [centerCartographic]; @@ -4926,7 +4924,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]; @@ -4934,14 +4932,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); }); - }, + } ); }); @@ -4956,7 +4954,7 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, 0.6988740001506679, - 2.4683731133709323, + 2.4683731133709323 ); const cartographics = [centerCartographic]; @@ -4965,7 +4963,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]; @@ -4973,14 +4971,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); }); - }, + } ); }); @@ -5002,7 +5000,7 @@ describe( const offcenterCartographic = new Cartographic( -1.3196754112739246, 0.6988705057695633, - 2.467395745774971, + 2.467395745774971 ); const cartographics = [offcenterCartographic]; @@ -5013,17 +5011,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); }); - }, + } ); }); @@ -5048,16 +5046,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); }); - }, + } ); }); @@ -5069,7 +5067,7 @@ describe( const centerCartographic = new Cartographic( -1.3196799798348215, 0.6988740001506679, - 2.4683731133709323, + 2.4683731133709323 ); const cartographics = [centerCartographic]; return Cesium3DTilesTester.loadTileset(scene, tilesetUniform).then( @@ -5078,10 +5076,10 @@ describe( return sampleHeightMostDetailed(cartographics).then(function () { expect(centerCartographic.height).toEqualEpsilon( 2.47, - CesiumMath.EPSILON1, + CesiumMath.EPSILON1 ); }); - }, + } ); }); @@ -5094,15 +5092,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, @@ -5115,11 +5113,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(); @@ -5127,7 +5125,7 @@ describe( tileset._statisticsPerPass[Cesium3DTilePass.MOST_DETAILED_PICK]; expect(statistics.numberOfTilesWithContentReady).toBe(2); }); - }, + } ); }); }); @@ -5164,7 +5162,7 @@ describe( allCancelled = allCancelled && tile._request.cancelled; } expect(allCancelled).toBe(true); - }, + } ); }); @@ -5194,7 +5192,7 @@ describe( expect(lastPriority).not.toEqual(requestedTilesInFlight[0]._priority); // Not all the same value return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }, + } ); }); @@ -5220,7 +5218,7 @@ describe( expect(requestedTilesInFlight[0].priorityDeferred).toBe(true); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }, + } ); }); @@ -5248,12 +5246,12 @@ describe( return tileset._requestedTilesInFlight.length !== 0; }).then(function () { expect(tileset._requestedTilesInFlight[0].priorityDeferred).toBe( - true, + true ); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); }); - }, + } ); }); @@ -5261,12 +5259,11 @@ 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(); @@ -5279,7 +5276,7 @@ describe( scene.renderForSpecs(); expect(tileset._requestedTilesInFlight.length).toBeGreaterThan(0); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }, + } ); }); @@ -5291,7 +5288,7 @@ describe( viewAllTiles(); scene.renderForSpecs(); expect(tileset._requestedTilesInFlight.length).toEqual(0); // Big camera delta so no fetches should occur. - }, + } ); }); @@ -5305,7 +5302,7 @@ describe( scene.renderForSpecs(); expect(tileset._requestedTilesInFlight.length).toEqual(2); return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset); - }, + } ); }); @@ -5323,14 +5320,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(); @@ -5360,7 +5357,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; @@ -5378,10 +5375,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); @@ -5403,7 +5400,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(); @@ -5441,7 +5438,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, gltfContentWithCopyrightUrl, - options, + options ).then(function (tileset) { setZoom(10.0); scene.renderForSpecs(); @@ -5474,7 +5471,7 @@ describe( return Cesium3DTilesTester.loadTileset( scene, gltfContentWithCopyrightUrl, - options, + options ).then(function (tileset) { setZoom(10.0); scene.renderForSpecs(); @@ -5545,14 +5542,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 @@ -5570,8 +5567,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(); @@ -5579,7 +5576,7 @@ describe( expect(implicitTile.implicitCoordinates.x).toEqual(0); expect(implicitTile.implicitCoordinates.y).toEqual(0); expect(implicitTile.implicitCoordinates.z).toEqual(0); - }, + } ); }); @@ -5592,15 +5589,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); - }, + } ); }); @@ -5627,7 +5624,7 @@ describe( tileset.debugShowUrl = false; scene.renderForSpecs(); expect(tileset._tileDebugLabels).not.toBeDefined(); - }, + } ); }); }); @@ -5645,7 +5642,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 @@ -5658,7 +5655,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 @@ -5672,14 +5669,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(); @@ -5694,15 +5691,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(); @@ -5715,7 +5712,7 @@ describe( it("debugShowUrl works for implicit tiling (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - implicitTilesetLegacyUrl, + implicitTilesetLegacyUrl ).then(function (tileset) { tileset.debugShowUrl = true; scene.renderForSpecs(); @@ -5755,7 +5752,7 @@ describe( expect(statistics.numberOfPendingRequests).toBe(0); expect(statistics.numberOfTilesProcessing).toBe(0); expect(statistics.numberOfTilesWithContentReady).toBe(1); - }, + } ); }); @@ -5822,9 +5819,8 @@ describe( expect(statistics.numberOfTilesProcessing).toBe(0); expect(statistics.numberOfTilesWithContentReady).toBe(0); - RequestScheduler.maximumRequestsPerServer = - oldMaximumRequestsPerServer; - }, + RequestScheduler.maximumRequestsPerServer = oldMaximumRequestsPerServer; + } ); }); @@ -5832,7 +5828,7 @@ describe( viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsUrl, + multipleContentsUrl ); let callCount = 0; tileset.tileFailed.addEventListener(function (event) { @@ -5877,7 +5873,7 @@ describe( it("verify multiple content statistics", async function () { const tileset = await Cesium3DTileset.fromUrl( multipleContentsUrl, - options, + options ); scene.primitives.add(tileset); @@ -5927,9 +5923,9 @@ describe( for (let i = 0; i < expected.length; i++) { expect(endsWith(uris[i], expected[i])).toBe(true); } - }, + } ); - }, + } ); }); @@ -5959,7 +5955,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); @@ -5997,7 +5993,7 @@ describe( tileset.debugShowUrl = false; scene.renderForSpecs(); expect(tileset._tileDebugLabels).not.toBeDefined(); - }, + } ); }); @@ -6012,14 +6008,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; @@ -6046,7 +6042,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); @@ -6074,7 +6070,7 @@ describe( viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl, + multipleContentsLegacyUrl ); viewAllTiles(); scene.renderForSpecs(); @@ -6108,7 +6104,7 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl, + multipleContentsLegacyUrl ).then(function (tileset) { const oldMaximumRequestsPerServer = RequestScheduler.maximumRequestsPerServer; @@ -6123,8 +6119,7 @@ describe( expect(statistics.numberOfTilesProcessing).toBe(0); expect(statistics.numberOfTilesWithContentReady).toBe(0); - RequestScheduler.maximumRequestsPerServer = - oldMaximumRequestsPerServer; + RequestScheduler.maximumRequestsPerServer = oldMaximumRequestsPerServer; }); }); @@ -6132,7 +6127,7 @@ describe( viewNothing(); const tileset = await Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl, + multipleContentsLegacyUrl ); let callCount = 0; tileset.tileFailed.addEventListener(function (event) { @@ -6176,7 +6171,7 @@ describe( it("verify multiple content statistics (legacy)", async function () { const tileset = await Cesium3DTileset.fromUrl( multipleContentsLegacyUrl, - options, + options ); scene.primitives.add(tileset); @@ -6210,7 +6205,7 @@ describe( viewNothing(); return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl, + multipleContentsLegacyUrl ).then(function (tileset) { tileset.tileFailed.addEventListener(function (event) { uris.push(event.url); @@ -6230,7 +6225,7 @@ describe( for (let i = 0; i < expected.length; i++) { expect(endsWith(uris[i], expected[i])).toBe(true); } - }, + } ); }); }); @@ -6268,14 +6263,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" ); }); @@ -6285,7 +6280,7 @@ describe( return Cesium3DTilesTester.waitForTilesLoaded(scene, tileset).then( function () { expect(errorCount).toBe(2); - }, + } ); }); }); @@ -6297,7 +6292,7 @@ describe( it("debugShowUrl lists each URI (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl, + multipleContentsLegacyUrl ).then(function (tileset) { tileset.debugShowUrl = true; scene.renderForSpecs(); @@ -6320,7 +6315,7 @@ describe( const totalCommands = b3dmCommands + i3dmCommands; return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyUrl, + multipleContentsLegacyUrl ).then(function (tileset) { const statistics = tileset._statistics; expect(statistics.visited).toEqual(1); @@ -6336,7 +6331,7 @@ describe( const totalCommands = b3dmCommands + i3dmCommands; return Cesium3DTilesTester.loadTileset( scene, - multipleContentsLegacyWithContentUrl, + multipleContentsLegacyWithContentUrl ).then(function (tileset) { const statistics = tileset._statistics; expect(statistics.visited).toEqual(1); @@ -6347,7 +6342,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 @@ -6360,7 +6355,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 @@ -6375,7 +6370,9 @@ describe( author: "Cesium", date: "2021-03-23", centerCartographic: [ - -1.3196816996258511, 0.6988767486400521, 45.78600543644279, + -1.3196816996258511, + 0.6988767486400521, + 45.78600543644279, ], tileCount: 5, }; @@ -6387,7 +6384,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"; @@ -6398,7 +6395,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; @@ -6409,7 +6406,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"; @@ -6420,7 +6417,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; @@ -6461,25 +6458,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(); @@ -6505,7 +6502,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]; @@ -6540,14 +6537,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(); @@ -6560,7 +6557,7 @@ describe( it("loads explicit tileset with tile metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitTileMetadataUrl, + tilesetWithExplicitTileMetadataUrl ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -6598,12 +6595,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 ); }); }); @@ -6614,7 +6611,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitTileMetadataUrl, + tilesetWithImplicitTileMetadataUrl ).then(function (tileset) { const placeholderTile = tileset.root; @@ -6657,10 +6654,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] ); } } @@ -6671,7 +6668,7 @@ describe( spyOn(findTileMetadata, "_oneTimeWarning"); return Cesium3DTilesTester.loadTileset( scene, - tilesetWithoutRootSchemaTileMetadataUrl, + tilesetWithoutRootSchemaTileMetadataUrl ).then(function (tileset) { expect(findTileMetadata._oneTimeWarning).toHaveBeenCalledTimes(5); @@ -6687,7 +6684,7 @@ describe( it("loads explicit tileset with content metadata", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitContentMetadataUrl, + tilesetWithExplicitContentMetadataUrl ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -6720,10 +6717,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 ); }); }); @@ -6734,7 +6731,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitContentMetadataUrl, + tilesetWithImplicitContentMetadataUrl ).then(function (tileset) { const placeholderTile = tileset.root; @@ -6776,10 +6773,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] ); } } @@ -6790,7 +6787,7 @@ describe( spyOn(findContentMetadata, "_oneTimeWarning"); return Cesium3DTilesTester.loadTileset( scene, - tilesetWithoutRootSchemaContentMetadataUrl, + tilesetWithoutRootSchemaContentMetadataUrl ).then(function (tileset) { expect(findContentMetadata._oneTimeWarning).toHaveBeenCalledTimes(5); @@ -6807,33 +6804,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 ); }); }); @@ -6843,7 +6840,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitMultipleContentsMetadataUrl, + tilesetWithImplicitMultipleContentsMetadataUrl ).then(function (tileset) { const placeholderTile = tileset.root; @@ -6896,10 +6893,10 @@ describe( } expect(buildingMetadata.getProperty("height")).toBe( - expectedHeights[index], + expectedHeights[index] ); expect(buildingMetadata.getProperty("color")).toEqual( - expectedColors[index], + expectedColors[index] ); if (i === 0) { @@ -6909,7 +6906,7 @@ describe( const treeContent = tile.content.innerContents[1]; const treeMetadata = treeContent.metadata; expect(treeMetadata.getProperty("age")).toEqual( - expectedAges[index - 1], + expectedAges[index - 1] ); } }); @@ -6939,7 +6936,7 @@ describe( it("loads tileset metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetMetadataLegacyUrl, + tilesetMetadataLegacyUrl ).then(function (tileset) { const metadata = tileset.metadataExtension; expect(metadata).toBeDefined(); @@ -6949,16 +6946,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 ); }); }); @@ -6966,7 +6963,7 @@ describe( it("loads group metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithGroupMetadataLegacyUrl, + tilesetWithGroupMetadataLegacyUrl ).then(function (tileset) { const metadata = tileset.metadataExtension; expect(metadata).toBeDefined(); @@ -6997,7 +6994,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]; @@ -7027,7 +7024,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(); @@ -7040,7 +7037,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(); @@ -7053,7 +7050,7 @@ describe( it("loads explicit tileset with tile metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitTileMetadataLegacyUrl, + tilesetWithExplicitTileMetadataLegacyUrl ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -7091,12 +7088,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 ); }); }); @@ -7107,7 +7104,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitTileMetadataLegacyUrl, + tilesetWithImplicitTileMetadataLegacyUrl ).then(function (tileset) { const placeholderTile = tileset.root; @@ -7150,10 +7147,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] ); } } @@ -7163,7 +7160,7 @@ describe( it("loads explicit tileset with content metadata (legacy)", function () { return Cesium3DTilesTester.loadTileset( scene, - tilesetWithExplicitContentMetadataLegacyUrl, + tilesetWithExplicitContentMetadataLegacyUrl ).then(function (tileset) { const expected = { "parent.b3dm": { @@ -7196,10 +7193,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 ); }); }); @@ -7210,7 +7207,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitContentMetadataLegacyUrl, + tilesetWithImplicitContentMetadataLegacyUrl ).then(function (tileset) { const placeholderTile = tileset.root; @@ -7252,10 +7249,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] ); } } @@ -7265,33 +7262,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 ); }); }); @@ -7301,7 +7298,7 @@ describe( // one tile is removed return Cesium3DTilesTester.loadTileset( scene, - tilesetWithImplicitMultipleContentsMetadataLegacyUrl, + tilesetWithImplicitMultipleContentsMetadataLegacyUrl ).then(function (tileset) { const placeholderTile = tileset.root; @@ -7354,10 +7351,10 @@ describe( } expect(buildingMetadata.getProperty("height")).toBe( - expectedHeights[index], + expectedHeights[index] ); expect(buildingMetadata.getProperty("color")).toEqual( - expectedColors[index], + expectedColors[index] ); if (i === 0) { @@ -7367,12 +7364,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 b556efb86b64..a5ea6957b880 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 858abb93b31a..903c4effd0fb 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,14 +492,13 @@ 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; @@ -540,17 +539,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; @@ -846,7 +845,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({ @@ -856,7 +855,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) ), }, }); @@ -873,7 +872,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) ), }, }); @@ -913,7 +912,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({ @@ -923,7 +922,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) ), }, }); @@ -989,7 +988,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 () { @@ -1126,7 +1125,7 @@ describe( verifyClassificationPrimitiveRender(primitive, boxColor); expect( - primitive.getGeometryInstanceAttributes("unknown"), + primitive.getGeometryInstanceAttributes("unknown") ).not.toBeDefined(); }); @@ -1182,5 +1181,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 958eaf3bd4ce..2fb563e969d6 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,21 +241,19 @@ 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(); @@ -277,29 +275,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(); @@ -363,22 +361,20 @@ 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, @@ -451,10 +447,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(); @@ -503,21 +499,19 @@ 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(); @@ -534,29 +528,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(); @@ -633,22 +627,20 @@ 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, @@ -733,7 +725,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes1, clippedObject1, - "clippingPlanes", + "clippingPlanes" ); expect(clippedObject1.clippingPlanes).toBe(clippingPlanes1); expect(clippingPlanes1._owner).toBe(clippedObject1); @@ -749,7 +741,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes2, clippedObject1, - "clippingPlanes", + "clippingPlanes" ); expect(clippingPlanes1.isDestroyed()).toBe(true); @@ -757,7 +749,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes2, clippedObject1, - "clippingPlanes", + "clippingPlanes" ); expect(clippingPlanes2.isDestroyed()).toBe(false); @@ -766,7 +758,7 @@ describe("Scene/ClippingPlaneCollection", function () { ClippingPlaneCollection.setOwner( clippingPlanes2, clippedObject2, - "clippingPlanes", + "clippingPlanes" ); }).toThrowDeveloperError(); }); @@ -780,35 +772,40 @@ 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); }); @@ -817,29 +814,34 @@ 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); }); @@ -848,14 +850,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); }); @@ -892,7 +894,7 @@ describe("Scene/ClippingPlaneCollection", function () { const predictedResolution = ClippingPlaneCollection.getTextureResolution( clippingPlanes, scene.frameState.context, - new Cartesian2(), + new Cartesian2() ); expect(predictedResolution.x).toEqual(4); @@ -902,7 +904,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 658d1e1e88f5..fae79735ef87 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 2e13ecb1804d..9ea882abc1f2 100644 --- a/packages/engine/Specs/Scene/ClippingPolygonCollectionSpec.js +++ b/packages/engine/Specs/Scene/ClippingPolygonCollectionSpec.js @@ -18,13 +18,24 @@ 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 () { @@ -165,7 +176,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(); @@ -247,19 +258,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 @@ -289,19 +300,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 @@ -341,19 +352,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 @@ -436,11 +447,10 @@ 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); @@ -457,11 +467,10 @@ 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); @@ -475,8 +484,9 @@ 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 })); @@ -486,7 +496,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); @@ -505,8 +515,9 @@ 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 })); @@ -516,7 +527,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 22c6e4abb56d..2519e35cb006 100644 --- a/packages/engine/Specs/Scene/ClippingPolygonSpec.js +++ b/packages/engine/Specs/Scene/ClippingPolygonSpec.js @@ -9,9 +9,16 @@ 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({ @@ -30,7 +37,10 @@ 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(() => { @@ -43,9 +53,16 @@ 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({ @@ -74,9 +91,16 @@ 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({ @@ -93,9 +117,16 @@ 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, ]), }); @@ -111,9 +142,16 @@ 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({ @@ -130,9 +168,16 @@ 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({ @@ -143,27 +188,34 @@ 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({ @@ -175,27 +227,34 @@ 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({ @@ -206,27 +265,34 @@ 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({ @@ -238,19 +304,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 47ec8db78506..a8283482baaa 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 42a7f7830e60..2dcea78122bc 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 133d6df1e7e6..43daf10cf2c8 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 9ae972485fc9..f3f94dd75adb 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 a08f776bf528..29b05222f003 100644 --- a/packages/engine/Specs/Scene/ContentMetadataSpec.js +++ b/packages/engine/Specs/Scene/ContentMetadataSpec.js @@ -147,23 +147,27 @@ 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 ad5698092150..d194b9abbef7 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 4301b7025c18..a83ed298e4d6 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 824066d4887a..0b84e009b4aa 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 1ad701b090cd..a48d463439a1 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 c74612efa46b..af76fa49b6d3 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 6da45e7870a3..d7e9ec1607d0 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 804d5826e59b..a10642594831 100644 --- a/packages/engine/Specs/Scene/DiscardMissingTileImagePolicySpec.js +++ b/packages/engine/Specs/Scene/DiscardMissingTileImagePolicySpec.js @@ -46,25 +46,27 @@ 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, @@ -73,7 +75,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toEqual(missingImageUrl); return Resource._DefaultImplementations.loadWithXhr( @@ -82,7 +84,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { method, data, headers, - deferred, + deferred ); }; @@ -119,7 +121,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }), + }) ); return Promise.all(promises, function (results) { @@ -145,7 +147,7 @@ describe("Scene/DiscardMissingTileImagePolicy", function () { promises.push( pollToPromise(function () { return policy.isReady(); - }), + }) ); return Promise.all(promises, function (results) { @@ -169,7 +171,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 7f1f4a555bca..71c1802eeca8 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 0452391632c9..c2b7e4092bfc 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 4d0f915cb398..b03e26ec9477 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 f5bfda1ca5d3..c1f1d8c9d7be 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 3de2f8a5b8d9..aee28edae5e0 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 6516c9ee6ed3..344dca690ce5 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 8afb4f78b93f..316131be6ef1 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,8 +376,18 @@ 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, }), @@ -387,14 +397,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 ); }); @@ -435,27 +445,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 ); }); @@ -479,7 +489,7 @@ describe( return renderAsync(instance); }); }, - "WebGL", + "WebGL" ); describe( @@ -503,7 +513,7 @@ describe( geometry = EllipseGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -545,7 +555,7 @@ describe( geometry = EllipseGeometry.createGeometry(rotated.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(rotated); }); @@ -568,12 +578,12 @@ describe( geometry = EllipseGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(atHeight); }); }, - "WebGL", + "WebGL" ); describe( @@ -603,7 +613,7 @@ describe( geometry = EllipseGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -632,14 +642,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); } @@ -649,18 +659,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( @@ -675,10 +685,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: { @@ -688,7 +698,7 @@ describe( geometry = EllipsoidGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -712,7 +722,7 @@ describe( return renderAsync(instance); }); }, - "WebGL", + "WebGL" ); describe( @@ -727,10 +737,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: { @@ -740,7 +750,7 @@ describe( geometry = SphereGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -764,7 +774,7 @@ describe( return renderAsync(instance); }); }, - "WebGL", + "WebGL" ); describe( @@ -788,7 +798,7 @@ describe( geometry = RectangleGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -827,7 +837,7 @@ describe( geometry = RectangleGeometry.createGeometry(rotated.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(rotated); }); @@ -847,7 +857,7 @@ describe( geometry = RectangleGeometry.createGeometry(rotated.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(rotated, undefined, appearance); }); @@ -867,12 +877,12 @@ describe( geometry = RectangleGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(atHeight); }); }, - "WebGL", + "WebGL" ); describe( @@ -902,7 +912,7 @@ describe( geometry = RectangleGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -929,11 +939,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); } @@ -943,11 +953,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); } @@ -957,11 +967,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); } @@ -971,11 +981,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); } @@ -985,18 +995,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( @@ -1009,7 +1019,14 @@ 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", @@ -1020,7 +1037,7 @@ describe( geometry = PolygonGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1050,7 +1067,14 @@ 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, }), @@ -1062,7 +1086,7 @@ describe( geometry = PolygonGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - atHeight.modelMatrix, + atHeight.modelMatrix ); render3D(atHeight); }); @@ -1073,17 +1097,38 @@ 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, ]), }, ], @@ -1099,12 +1144,12 @@ describe( geometry = PolygonGeometry.createGeometry(hierarchy.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - hierarchy.modelMatrix, + hierarchy.modelMatrix ); render3D(hierarchy); }); }, - "WebGL", + "WebGL" ); describe( @@ -1123,7 +1168,14 @@ 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, @@ -1136,7 +1188,7 @@ describe( geometry = PolygonGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1165,14 +1217,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); } @@ -1182,11 +1234,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); } @@ -1196,11 +1248,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); } @@ -1210,11 +1262,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); } @@ -1224,11 +1276,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); } @@ -1241,8 +1293,18 @@ 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, @@ -1255,16 +1317,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); @@ -1272,7 +1334,7 @@ describe( render3D(instance, afterView); }); }, - "WebGL", + "WebGL" ); describe( @@ -1305,23 +1367,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); @@ -1348,7 +1410,7 @@ describe( return renderAsync(instance, afterView3D); }); }, - "WebGL", + "WebGL" ); describe( @@ -1376,7 +1438,7 @@ describe( geometry = CorridorGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1417,12 +1479,12 @@ describe( geometry = CorridorGeometry.createGeometry(atHeight.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - atHeight.modelMatrix, + atHeight.modelMatrix ); render3D(atHeight); }); }, - "WebGL", + "WebGL" ); describe( @@ -1455,7 +1517,7 @@ describe( geometry = CorridorGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1484,14 +1546,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); } @@ -1501,11 +1563,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); } @@ -1515,11 +1577,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); } @@ -1529,11 +1591,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); } @@ -1543,18 +1605,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( @@ -1590,7 +1652,7 @@ describe( geometry = PolylineVolumeGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1619,14 +1681,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); } @@ -1636,11 +1698,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); } @@ -1650,11 +1712,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); } @@ -1664,11 +1726,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); } @@ -1678,18 +1740,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( @@ -1709,7 +1771,7 @@ describe( geometry = SimplePolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1747,7 +1809,7 @@ describe( geometry = SimplePolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(instance); }); @@ -1767,12 +1829,12 @@ describe( geometry = SimplePolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(instance); }); }, - "WebGL", + "WebGL" ); describe( @@ -1799,7 +1861,7 @@ describe( geometry = PolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); }); @@ -1839,7 +1901,7 @@ describe( geometry = PolylineGeometry.createGeometry(instance.geometry); geometry.boundingSphereWC = BoundingSphere.transform( geometry.boundingSphere, - instance.modelMatrix, + instance.modelMatrix ); render3D(instance, undefined, appearance); }); @@ -1861,12 +1923,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 () { @@ -1882,8 +1944,18 @@ 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, ]), }), }, @@ -1892,10 +1964,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: { @@ -1904,11 +1976,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 ); }); @@ -1928,7 +2000,7 @@ describe( pickGeometry(instance); }); }, - "WebGL", + "WebGL" ); describe( @@ -1943,9 +2015,24 @@ 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, ]), }), }, @@ -1953,10 +2040,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: { @@ -1965,11 +2052,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 ); }); @@ -1989,7 +2076,7 @@ describe( pickGeometry(instance); }); }, - "WebGL", + "WebGL" ); describe( @@ -2004,8 +2091,18 @@ 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, ], }), }, @@ -2014,10 +2111,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: { @@ -2026,11 +2123,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 ); }); @@ -2050,9 +2147,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 4a4d25f4ce25..af2863a7a40f 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 a108ae40c1e0..b591e61c10c6 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,202 +162,181 @@ 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; } - expect(hasImageFromLayer2).toEqual(true); - }, - ); + if (imageryTile.imageryLayer === layer2) { + hasImageFromLayer2 = 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; - } - if (imageryTile.imageryLayer === layer2) { - ++tilesFromLayer2; - } + 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; } - expect(tilesFromLayer2).toBe(1); - }, - ); + if (imageryTile.imageryLayer === layer2) { + ++tilesFromLayer2; + } + } + 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(); @@ -369,43 +348,37 @@ 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); @@ -416,13 +389,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); @@ -433,13 +406,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); @@ -450,13 +423,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); @@ -467,13 +440,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); @@ -484,13 +457,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); @@ -503,20 +476,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) ); }); @@ -528,7 +501,7 @@ describe( "Data/Images/Red16x16.png", { credit: imageryCredit, - }, + } ); const layer = scene.imageryLayers.addImageryProvider(provider); @@ -537,13 +510,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(); @@ -553,14 +526,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 @@ -579,14 +552,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 @@ -613,14 +586,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 @@ -650,7 +623,7 @@ describe( scene.fog.enabled = false; switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(scene.globe).then(function () { @@ -660,12 +633,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); @@ -673,7 +646,7 @@ describe( switchViewMode( SceneMode.COLUMBUS_VIEW, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(scene.globe); @@ -691,7 +664,7 @@ describe( scene.imageryLayers.addImageryProvider(providerWithInvalidRootTiles); switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(scene.globe).then(function () { @@ -703,7 +676,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); @@ -719,7 +692,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(scene.globe); @@ -756,14 +729,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; @@ -785,13 +758,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; @@ -829,7 +802,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); @@ -837,7 +810,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(scene.globe); @@ -864,7 +837,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); @@ -872,7 +845,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(scene.globe); @@ -896,12 +869,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); } @@ -929,7 +902,7 @@ describe( "Data/Images/Red16x16.png", { credit: imageryCredit, - }, + } ); scene.imageryLayers.addImageryProvider(provider); @@ -943,7 +916,7 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ) { if (defined(url.match(/\/\d+\/\d+\/\d+\.terrain/))) { Resource._DefaultImplementations.loadWithXhr( @@ -952,7 +925,7 @@ describe( method, data, headers, - deferred, + deferred ); return; } @@ -964,24 +937,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(); }); @@ -996,8 +969,7 @@ describe( expect(replacementQueue.count).toBeGreaterThan(0); const oldTile = replacementQueue.head; - surface.tileProvider.terrainProvider = - new EllipsoidTerrainProvider(); + surface.tileProvider.terrainProvider = new EllipsoidTerrainProvider(); scene.renderForSpecs(); @@ -1048,7 +1020,7 @@ describe( expect(levelZeroTiles[1]).toBe(levelZero1); }); }, - "WebGL", + "WebGL" ); it("renders back side of globe when camera is near the poles", function () { @@ -1056,27 +1028,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 () { @@ -1096,7 +1068,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(scene.globe).then(function () { @@ -1128,7 +1100,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(scene.globe).then(function () { @@ -1162,7 +1134,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(scene.globe).then(function () { @@ -1196,7 +1168,7 @@ describe( const globe = scene.globe; switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(globe).then(function () { @@ -1212,7 +1184,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(globe).then(function () { @@ -1231,7 +1203,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(globe).then(function () { @@ -1250,7 +1222,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); return updateUntilDone(globe).then(function () { @@ -1280,7 +1252,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; @@ -1292,9 +1264,16 @@ 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; @@ -1311,7 +1290,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(scene.globe); @@ -1345,7 +1324,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(scene.globe); @@ -1358,9 +1337,14 @@ 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({ @@ -1389,7 +1373,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(globe); @@ -1410,7 +1394,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(globe); @@ -1431,7 +1415,7 @@ describe( switchViewMode( SceneMode.SCENE3D, - new GeographicProjection(Ellipsoid.WGS84), + new GeographicProjection(Ellipsoid.WGS84) ); await updateUntilDone(globe); @@ -1459,7 +1443,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; @@ -1474,7 +1458,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) @@ -1488,7 +1472,7 @@ describe( -2, -2, -1, - -1, + -1 ); expect(scene).notToRender(result); scene.camera.setView({ @@ -1504,14 +1488,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) @@ -1521,13 +1505,13 @@ describe( -2, -2, -1, - -1, + -1 ); return updateUntilDone(scene.globe); }) .then(function () { expect(unculledCommandCount).toBeGreaterThan( - scene.frameState.commandList.length, + scene.frameState.commandList.length ); }); }); @@ -1535,7 +1519,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) @@ -1545,13 +1529,13 @@ describe( 179, -2, -179, - -1, + -1 ); return updateUntilDone(scene.globe); }) .then(function () { expect(unculledCommandCount).toBeGreaterThan( - scene.frameState.commandList.length, + scene.frameState.commandList.length ); }); }); @@ -1559,14 +1543,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 @@ -1575,12 +1559,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); @@ -1588,7 +1572,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 }); @@ -1597,7 +1581,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); @@ -1605,58 +1589,48 @@ 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); - }, - ); + 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) { - 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); - }, - ); + 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); + }); 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); - }, - ); + 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); + }); }); }); }); @@ -1671,7 +1645,7 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ) { if (defined(url.match(/\/\d+\/\d+\/\d+\.terrain/))) { Resource._DefaultImplementations.loadWithXhr( @@ -1680,7 +1654,7 @@ describe( method, data, headers, - deferred, + deferred ); return; } @@ -1692,14 +1666,14 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; scene.terrainProvider = await CesiumTerrainProvider.fromUrl( "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json", { requestWaterMask: true, - }, + } ); scene.globe.showWaterEffect = false; @@ -1708,5 +1682,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 3f9f2cf6c013..10a31d4201da 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,17 +356,18 @@ 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); }); @@ -395,7 +396,7 @@ describe("Scene/GlobeSurfaceTile", function () { ray, undefined, undefined, - cullBackFaces, + cullBackFaces ); expect(pickResult.x).toBeGreaterThan(0.0); }); @@ -424,13 +425,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 8ce1b8ad8502..97b58d8bef0f 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 540d2507e52d..c5a55ddcb988 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,16 +630,16 @@ describe("Scene/GlobeTranslucencyState", function () { executeCommand, framebuffer, scene, - passState, + passState ); expect(executeCommand).toHaveBeenCalledWith( command.derivedCommands.globeTranslucency.opaqueBackFaceCommand, scene, - passState, + passState ); expect( - GlobeTranslucencyFramebuffer.prototype.clearClassification, + GlobeTranslucencyFramebuffer.prototype.clearClassification ).toHaveBeenCalled(); }); @@ -655,7 +655,7 @@ describe("Scene/GlobeTranslucencyState", function () { executeCommand, framebuffer, scene, - passState, + passState ); expect(executeCommand).not.toHaveBeenCalled(); @@ -684,8 +684,9 @@ 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; @@ -694,23 +695,23 @@ describe("Scene/GlobeTranslucencyState", function () { executeCommand, framebuffer, scene, - passState, + passState ); expect(executeCommand).toHaveBeenCalledWith( classificationCommand, scene, - passState, + passState ); expect(executeCommand).toHaveBeenCalledWith( command.derivedCommands.globeTranslucency.depthOnlyFrontFaceCommand, scene, - 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 072d77c113f4..97fb9610212e 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 adb10f2f1d89..7819df4ae663 100644 --- a/packages/engine/Specs/Scene/GltfBuilder.js +++ b/packages/engine/Specs/Scene/GltfBuilder.js @@ -96,10 +96,11 @@ 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; @@ -342,8 +343,9 @@ 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 d6aada9505b2..4d99a8c995f4 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 81cfcd325559..ef1310a09c14 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 18baacf9f881..ecd36f1209d8 100644 --- a/packages/engine/Specs/Scene/GltfIndexBufferLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfIndexBufferLoaderSpec.js @@ -20,7 +20,14 @@ 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; @@ -344,7 +351,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({ @@ -358,13 +365,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 () { @@ -384,16 +391,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 @@ -401,14 +408,15 @@ 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, @@ -424,17 +432,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(); @@ -452,18 +460,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({ @@ -480,19 +488,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({ @@ -509,13 +517,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({ @@ -551,7 +559,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 @@ -579,20 +587,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); @@ -617,17 +625,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({ @@ -655,21 +663,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({ @@ -709,7 +717,7 @@ describe( spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => rejectPromise ? Promise.reject(new Error()) - : Promise.resolve(arrayBuffer), + : Promise.resolve(arrayBuffer) ); expect(indexBufferLoader.buffer).not.toBeDefined(); @@ -752,7 +760,7 @@ describe( const decodeBufferView = spyOn( DracoLoader, - "decodeBufferView", + "decodeBufferView" ).and.callFake(function () { return new Promise(function (resolve, reject) { if (rejectPromise) { @@ -767,7 +775,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 @@ -783,5 +791,5 @@ describe( return resolveDracoAfterDestroy(true); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/GltfJsonLoaderSpec.js b/packages/engine/Specs/Scene/GltfJsonLoaderSpec.js index 1978618855ae..84549d70126b 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,9 +949,7 @@ 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({ @@ -979,7 +977,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 8a6bae03d5c7..cfcab67f19d3 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,18 +1185,19 @@ 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); @@ -1219,7 +1220,7 @@ describe( const featureIdTexture = primitive.featureIds[0]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(256); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1231,7 +1232,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; @@ -1240,7 +1241,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); @@ -1252,13 +1253,16 @@ 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); @@ -1282,7 +1286,7 @@ describe( let featureIdTexture = primitive.featureIds[0]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(1048576); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1298,7 +1302,7 @@ describe( featureIdTexture = primitive.featureIds[1]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(1048576); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1312,7 +1316,7 @@ describe( featureIdTexture = primitive.featureIds[2]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(256); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1325,7 +1329,7 @@ describe( featureIdTexture = primitive.featureIds[3]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(65536); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1338,7 +1342,7 @@ describe( featureIdTexture = primitive.featureIds[4]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(65536); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1351,7 +1355,7 @@ describe( featureIdTexture = primitive.featureIds[5]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(1048576); expect(featureIdTexture.nullFeatureId).not.toBeDefined(); @@ -1364,7 +1368,7 @@ describe( featureIdTexture = primitive.featureIds[6]; expect(featureIdTexture).toBeInstanceOf( - ModelComponents.FeatureIdTexture, + ModelComponents.FeatureIdTexture ); expect(featureIdTexture.featureCount).toEqual(255); expect(featureIdTexture.nullFeatureId).toBe(10); @@ -1387,16 +1391,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; @@ -1405,11 +1409,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); @@ -1429,7 +1433,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(); @@ -1441,7 +1445,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(); @@ -1455,7 +1459,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); @@ -1498,7 +1502,7 @@ describe( for (let i = 0; i < 10; i++) { const temperature = propertyTable.getProperty( i, - "temperatureCelsius", + "temperatureCelsius" ); expect(temperature).toBeGreaterThanOrEqual(18); expect(temperature).toBeLessThanOrEqual(24); @@ -1516,16 +1520,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; @@ -1534,11 +1538,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); @@ -1558,7 +1562,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(); @@ -1570,7 +1574,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(); @@ -1584,7 +1588,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); @@ -1617,12 +1621,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; @@ -1636,7 +1640,7 @@ describe( const featureIdAttributeMapping0 = primitive.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange, + ModelComponents.FeatureIdImplicitRange ); expect(featureIdAttributeMapping0.featureCount).toEqual(1000); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -1648,7 +1652,7 @@ describe( const featureIdAttributeMapping1 = primitive.featureIds[1]; expect(featureIdAttributeMapping1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute, + ModelComponents.FeatureIdAttribute ); expect(featureIdAttributeMapping1.featureCount).toEqual(3); expect(featureIdAttributeMapping1.nullFeatureId).not.toBeDefined(); @@ -1660,14 +1664,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; @@ -1676,7 +1680,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); @@ -1685,22 +1689,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); @@ -1726,12 +1730,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; @@ -1745,7 +1749,7 @@ describe( const featureIdAttributeMapping0 = primitive.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange, + ModelComponents.FeatureIdImplicitRange ); expect(featureIdAttributeMapping0.featureCount).toEqual(1000); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -1757,7 +1761,7 @@ describe( const featureIdAttributeMapping1 = primitive.featureIds[1]; expect(featureIdAttributeMapping1).toBeInstanceOf( - ModelComponents.FeatureIdAttribute, + ModelComponents.FeatureIdAttribute ); expect(featureIdAttributeMapping1.featureCount).toEqual(3); expect(featureIdAttributeMapping1.nullFeatureId).not.toBeDefined(); @@ -1769,14 +1773,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); @@ -1786,7 +1790,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); @@ -1794,22 +1798,26 @@ 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); @@ -1826,128 +1834,130 @@ 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; + 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); + expect(primitive.primitiveType).toBe(PrimitiveType.POINTS); - 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", - ); + expect(positionAttribute).toBeDefined(); + expect(color0Attribute).toBeDefined(); + expect(circleTAttribute).toBeDefined(); + expect(featureId0Attribute).toBeDefined(); + expect(featureId1Attribute).toBeDefined(); - // 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); - }, - ); + 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" + ); + + // 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 () { @@ -1961,24 +1971,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; @@ -1990,11 +2000,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); @@ -2026,11 +2036,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); @@ -2048,7 +2058,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); @@ -2066,7 +2076,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); @@ -2092,7 +2102,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); @@ -2104,10 +2114,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); @@ -2120,7 +2130,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); @@ -2128,18 +2138,21 @@ 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); @@ -2156,12 +2169,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)); @@ -2191,7 +2204,7 @@ describe( const interleaved = defaultValue(options.interleaved, false); const instancingDisabled = defaultValue( options.instancingDisabled, - false, + false ); const components = loader.components; @@ -2201,40 +2214,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); @@ -2244,17 +2257,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); @@ -2270,7 +2283,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); @@ -2292,7 +2305,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); @@ -2300,7 +2313,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); @@ -2313,7 +2326,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 { @@ -2345,7 +2358,7 @@ describe( const featureIdAttributeMapping0 = instances.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange, + ModelComponents.FeatureIdImplicitRange ); expect(featureIdAttributeMapping0.featureCount).toEqual(4); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -2354,12 +2367,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(); @@ -2367,7 +2380,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; @@ -2375,7 +2388,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; @@ -2384,7 +2397,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); @@ -2423,7 +2436,7 @@ describe( const featureIdAttributeMapping0 = instances.featureIds[0]; expect(featureIdAttributeMapping0).toBeInstanceOf( - ModelComponents.FeatureIdImplicitRange, + ModelComponents.FeatureIdImplicitRange ); expect(featureIdAttributeMapping0.featureCount).toEqual(4); expect(featureIdAttributeMapping0.nullFeatureId).not.toBeDefined(); @@ -2432,12 +2445,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(); @@ -2445,7 +2458,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; @@ -2453,7 +2466,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; @@ -2462,7 +2475,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); @@ -2524,7 +2537,7 @@ describe( return loadModifiedGltfAndTest( boxInstanced, undefined, - modifyGltf, + modifyGltf ).then(function (gltfLoader) { const components = gltfLoader.components; const scene = components.scene; @@ -2534,7 +2547,7 @@ describe( const featureIdAttribute = getAttribute( instancedAttributes, InstanceAttributeSemantic.FEATURE_ID, - 0, + 0 ); expect(featureIdAttribute.buffer).toBeUndefined(); @@ -2555,21 +2568,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; @@ -2578,27 +2591,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); @@ -2617,7 +2630,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(); @@ -2648,7 +2661,7 @@ describe( gltfLoader, expectMinMax, expectBufferDefined, - expectTypedArrayDefined, + expectTypedArrayDefined ); }); }); @@ -2657,39 +2670,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 + ); + }); }); }); @@ -2703,16 +2716,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; @@ -2722,11 +2735,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); @@ -2735,15 +2748,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(); @@ -2752,24 +2765,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); @@ -2784,15 +2797,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(); @@ -2804,26 +2817,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(); @@ -2832,16 +2845,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); @@ -2868,16 +2881,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(); @@ -2904,14 +2917,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); @@ -2981,7 +2994,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); @@ -3014,7 +3027,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); }); @@ -3028,11 +3041,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(); @@ -3045,7 +3058,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(); @@ -3064,25 +3077,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)); @@ -3090,14 +3103,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; @@ -3118,13 +3131,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(); @@ -3148,14 +3161,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 = { @@ -3170,7 +3183,7 @@ describe( it("releases glTF JSON after unload", function () { const destroyGltfJsonLoader = spyOn( GltfJsonLoader.prototype, - "destroy", + "destroy" ).and.callThrough(); const options = { @@ -3187,7 +3200,7 @@ describe( it("creates GPU resources asynchronously", function () { const jobSchedulerExecute = spyOn( JobScheduler.prototype, - "execute", + "execute" ).and.callThrough(); const options = { @@ -3202,7 +3215,7 @@ describe( it("creates GPU resources synchronously", function () { const jobSchedulerExecute = spyOn( JobScheduler.prototype, - "execute", + "execute" ).and.callThrough(); const options = { @@ -3258,22 +3271,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) { @@ -3299,17 +3312,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 = { @@ -3321,10 +3334,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); @@ -3348,7 +3361,7 @@ describe( } }); spyOn(GltfJsonLoader.prototype, "_fetchGltf").and.returnValue( - fetchPromise, + fetchPromise ); const gltfUri = "https://example.com/model.glb"; @@ -3407,13 +3420,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(); @@ -3436,13 +3449,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(); @@ -3468,11 +3481,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(); @@ -3497,50 +3510,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(); + }); }); }); @@ -3559,11 +3572,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(); @@ -3597,7 +3610,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(); @@ -3621,21 +3634,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(); @@ -3643,7 +3656,7 @@ describe( const featureIdAttribute = getAttribute( instancedAttributes, InstanceAttributeSemantic.FEATURE_ID, - 0, + 0 ); expect(featureIdAttribute.typedArray).toBeUndefined(); expect(featureIdAttribute.buffer).toBeDefined(); @@ -3655,51 +3668,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 () { @@ -3707,52 +3720,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); + }); }); }); @@ -3771,21 +3784,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(); @@ -3812,16 +3825,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(); @@ -3833,7 +3846,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(); @@ -3858,7 +3871,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION, + VertexAttributeSemantic.POSITION ); expect(positionAttribute).toBeDefined(); expect(positionAttribute.buffer).toBeDefined(); @@ -3885,17 +3898,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(); @@ -3922,7 +3935,7 @@ describe( const attributes = primitive.attributes; const positionAttribute = getAttribute( attributes, - VertexAttributeSemantic.POSITION, + VertexAttributeSemantic.POSITION ); expect(positionAttribute).toBeDefined(); @@ -3946,20 +3959,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(); @@ -3978,10 +3991,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." ); }); @@ -3991,10 +4004,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." ); }); }); @@ -4009,16 +4022,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(); @@ -4043,92 +4056,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; + 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, - ); + 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).not.toBeDefined(); - expect(texCoordAttribute).not.toBeDefined(); + expect(positionAttribute).toBeDefined(); + expect(normalAttribute).not.toBeDefined(); + expect(texCoordAttribute).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(); - }, - ); + 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 () { @@ -4139,7 +4152,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); }); @@ -4148,8 +4161,11 @@ 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); @@ -4195,5 +4211,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/GltfLoaderUtilSpec.js b/packages/engine/Specs/Scene/GltfLoaderUtilSpec.js index bef2cf665012..dd30771963ef 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 abbc32ae0f9d..6901bbdf1657 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 b6414a5f6182..0845aca115ab 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,14 +263,15 @@ 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, @@ -290,13 +291,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({ @@ -403,18 +404,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({ @@ -436,7 +437,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({ @@ -457,7 +458,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({ @@ -478,17 +479,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({ @@ -524,7 +525,7 @@ describe( } else { resolve(image); } - }), + }) ); const textureLoader = new GltfTextureLoader({ @@ -554,5 +555,5 @@ describe( return resolveImageAfterDestroy(true); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js b/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js index 9e6670d5f5b2..8351e05d96dc 100644 --- a/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js +++ b/packages/engine/Specs/Scene/GltfVertexBufferLoaderSpec.js @@ -20,7 +20,14 @@ 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; @@ -347,7 +354,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({ @@ -361,13 +368,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 () { @@ -388,16 +395,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 @@ -405,14 +412,15 @@ 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, @@ -431,13 +439,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(); @@ -457,19 +465,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 @@ -477,14 +485,15 @@ 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, @@ -503,7 +512,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 + @@ -513,7 +522,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({ @@ -535,7 +544,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 @@ -564,31 +573,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 () { @@ -610,7 +619,7 @@ describe( await waitForLoaderProcess(vertexBufferLoader, scene); expect(vertexBufferLoader.buffer.sizeInBytes).toBe( - decodedNormals.byteLength, + decodedNormals.byteLength ); const quantization = vertexBufferLoader.quantization; @@ -620,23 +629,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({ @@ -664,21 +673,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({ @@ -710,7 +719,7 @@ describe( spyOn(Resource.prototype, "fetchArrayBuffer").and.callFake(() => rejectPromise ? Promise.reject(new Error()) - : Promise.resolve(arrayBuffer), + : Promise.resolve(arrayBuffer) ); const vertexBufferLoader = new GltfVertexBufferLoader({ @@ -764,7 +773,7 @@ describe( const decodeBufferView = spyOn( DracoLoader, - "decodeBufferView", + "decodeBufferView" ).and.callFake(function () { return new Promise(function (resolve, reject) { setTimeout(function () { @@ -781,7 +790,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 @@ -797,5 +806,5 @@ describe( return resolveDracoAfterDestroy(true); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js b/packages/engine/Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js index 416514c4a68e..6a476a32a0a6 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,11 +180,12 @@ 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 ); }); @@ -193,8 +194,9 @@ 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); @@ -205,8 +207,9 @@ 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); @@ -216,10 +219,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(); @@ -234,8 +237,9 @@ 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; @@ -257,7 +261,7 @@ describe("Scene/GoogleEarthEnterpriseImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { if (tries === 2) { // Succeed after 2 tries @@ -267,7 +271,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 987fdde44c41..43791beaf69d 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 745249679cd3..c2236aea20ac 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 8d71a98f6bb9..e7e7347483e8 100644 --- a/packages/engine/Specs/Scene/GroundPolylinePrimitiveSpec.js +++ b/packages/engine/Specs/Scene/GroundPolylinePrimitiveSpec.js @@ -105,8 +105,9 @@ 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({ @@ -130,7 +131,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({ @@ -164,7 +165,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); @@ -190,7 +191,7 @@ describe( }); expect(groundPolylinePrimitive.geometryInstances).toEqual( - geometryInstances, + geometryInstances ); expect(groundPolylinePrimitive.show).toEqual(false); expect(groundPolylinePrimitive.interleave).toEqual(true); @@ -306,7 +307,7 @@ describe( groundPolylinePrimitive = scene.groundPrimitives.add( new GroundPolylinePrimitive({ geometryInstances: groundPolylineInstance, - }), + }) ); groundPolylinePrimitive.show = false; @@ -355,7 +356,7 @@ describe( function verifyGroundPolylinePrimitiveRender( lookPosition, primitive, - color, + color ) { scene.camera.lookAt(lookPosition, Cartesian3.UNIT_Z); @@ -387,7 +388,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); }); @@ -406,7 +407,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); }); @@ -425,7 +426,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); }); @@ -487,7 +488,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) ), }, }); @@ -503,7 +504,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) ), }, }); @@ -517,7 +518,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - [192, 192, 255, 255], + [192, 192, 255, 255] ); }); @@ -581,11 +582,11 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain", + "polyline on terrain" ); expect(attributes.color).toBeDefined(); }); @@ -604,7 +605,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); // Remove so it can be re-added, but don't destroy. @@ -614,7 +615,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; @@ -622,7 +623,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - newColor, + newColor ); }); @@ -640,7 +641,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPositionOffset, groundPolylinePrimitive, - polylineColor, + polylineColor ); scene.groundPrimitives.destroyPrimitives = false; @@ -648,7 +649,7 @@ describe( scene.groundPrimitives.destroyPrimitives = true; const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain", + "polyline on terrain" ); expect(attributes.width).toBeDefined(); attributes.width = [0]; @@ -656,7 +657,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPositionOffset, groundPolylinePrimitive, - depthColor, + depthColor ); }); @@ -665,8 +666,9 @@ describe( return; } - groundPolylineInstance.attributes.show = - new ShowGeometryInstanceAttribute(true); + groundPolylineInstance.attributes.show = new ShowGeometryInstanceAttribute( + true + ); groundPolylinePrimitive = new GroundPolylinePrimitive({ geometryInstances: groundPolylineInstance, @@ -677,7 +679,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); scene.groundPrimitives.destroyPrimitives = false; @@ -685,7 +687,7 @@ describe( scene.groundPrimitives.destroyPrimitives = true; const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes( - "polyline on terrain", + "polyline on terrain" ); expect(attributes.show).toBeDefined(); attributes.show = [0]; @@ -693,7 +695,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - depthColor, + depthColor ); }); @@ -719,8 +721,10 @@ describe( }), id: "polyline on terrain", attributes: { - distanceDisplayCondition: - new DistanceDisplayConditionGeometryInstanceAttribute(near, far), + distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute( + near, + far + ), color: polylineColorAttribute, }, }); @@ -735,16 +739,15 @@ 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(); @@ -752,11 +755,7 @@ 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(); @@ -764,7 +763,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(); @@ -776,8 +775,9 @@ 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,10 +1008,9 @@ 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(); @@ -1032,7 +1031,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); expect(function () { @@ -1088,7 +1087,7 @@ describe( verifyGroundPolylinePrimitiveRender( lookPosition, groundPolylinePrimitive, - polylineColor, + polylineColor ); }); }); @@ -1141,5 +1140,5 @@ describe( ApproximateTerrainHeights._terrainHeights = terrainHeights; }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/GroundPrimitiveSpec.js b/packages/engine/Specs/Scene/GroundPrimitiveSpec.js index 1c77f26b5245..1fffa328d6fb 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,14 +810,13 @@ 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; @@ -846,7 +845,7 @@ describe( scene.invertClassificationColor = new Color(0.25, 0.25, 0.25, 0.25); rectangleInstance.attributes.show = new ShowGeometryInstanceAttribute( - true, + true ); primitive = new GroundPrimitive({ @@ -860,17 +859,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; @@ -978,7 +977,7 @@ describe( } rectangleInstance.attributes.show = new ShowGeometryInstanceAttribute( - true, + true ); primitive = new GroundPrimitive({ @@ -1017,7 +1016,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({ @@ -1027,8 +1026,10 @@ describe( id: "rect", attributes: { color: rectColorAttribute, - distanceDisplayCondition: - new DistanceDisplayConditionGeometryInstanceAttribute(near, far), + distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute( + near, + far + ), }, }); @@ -1042,30 +1043,26 @@ 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]); }); @@ -1257,7 +1254,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({ @@ -1266,7 +1263,7 @@ describe( rectangle.west, rectangle.south, rectangle.east, - (rectangle.north + rectangle.south) * 0.5, + (rectangle.north + rectangle.south) * 0.5 ), }), id: "rectangle1", @@ -1275,7 +1272,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({ @@ -1284,7 +1281,7 @@ describe( rectangle.west, (rectangle.north + rectangle.south) * 0.5, rectangle.east, - rectangle.north, + rectangle.north ), }), id: "rectangle2", @@ -1309,7 +1306,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({ @@ -1318,7 +1315,7 @@ describe( rectangle.west, rectangle.south, rectangle.east, - (rectangle.north + rectangle.south) * 0.5, + (rectangle.north + rectangle.south) * 0.5 ), }), id: "rectangle1", @@ -1333,7 +1330,7 @@ describe( rectangle.west, (rectangle.north + rectangle.south) * 0.5, rectangle.east, - rectangle.north, + rectangle.north ), }), id: "rectangle2", @@ -1433,7 +1430,7 @@ describe( verifyGroundPrimitiveRender(primitive, rectColor); expect( - primitive.getGeometryInstanceAttributes("unknown"), + primitive.getGeometryInstanceAttributes("unknown") ).not.toBeDefined(); }); @@ -1514,5 +1511,5 @@ describe( ApproximateTerrainHeights._terrainHeights = terrainHeights; }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/GroupMetadataSpec.js b/packages/engine/Specs/Scene/GroupMetadataSpec.js index 883a28517d29..c5f3cd9cfcc7 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 b773fa271203..06835f4d42a9 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,9 +560,33 @@ 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, @@ -577,7 +601,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, @@ -595,14 +619,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); @@ -621,18 +645,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 ); } } @@ -643,9 +667,33 @@ 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, @@ -660,7 +708,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, @@ -679,14 +727,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); @@ -705,18 +753,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 52efa9ea37d2..f1f1989d0bd4 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 52e3c3b6788f..feeec5984ae6 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 2d1031b287d9..e74abfd4cae8 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 41aab81626af..c5832c28f3ba 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 8cdf6e51e6a2..f7cc79df1263 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,23 +444,74 @@ 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], }; @@ -470,25 +521,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 = { @@ -583,12 +634,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 () { @@ -600,12 +651,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 @@ -623,12 +674,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); @@ -640,12 +691,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); @@ -663,13 +714,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); @@ -686,41 +737,42 @@ describe("Scene/I3SNode", function () { const nodeOrigin = new Cartesian3( childNode._globalTransform[3], childNode._globalTransform[7], - childNode._globalTransform[11], + childNode._globalTransform[11] + ); + const cartographicOrigin = Ellipsoid.WGS84.cartesianToCartographic( + nodeOrigin ); - 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); @@ -748,12 +800,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); @@ -770,49 +822,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() @@ -822,10 +874,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); @@ -845,7 +897,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); @@ -874,11 +926,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); @@ -886,7 +938,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData, + mockLayerData ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); rootNode._data = { @@ -903,7 +955,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); @@ -911,7 +963,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData, + mockLayerData ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -922,11 +974,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); @@ -934,7 +986,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData, + mockLayerData ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); rootNode._data = { @@ -951,7 +1003,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); @@ -959,7 +1011,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData, + mockLayerData ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -970,7 +1022,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); @@ -978,7 +1030,7 @@ describe("Scene/I3SNode", function () { const mockI3SLayerWithNodePages = await createMockLayer( "mockProviderUrl?testQuery=test", - mockLayerData, + mockLayerData ); const rootNode = new I3SNode(mockI3SLayerWithNodePages, 1, true); @@ -989,17 +1041,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 @@ -1011,18 +1063,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(); @@ -1034,19 +1086,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 @@ -1058,10 +1110,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 @@ -1071,12 +1123,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 = {}; @@ -1088,21 +1140,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 @@ -1117,7 +1169,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); @@ -1127,7 +1179,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); @@ -1140,21 +1192,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 @@ -1182,26 +1234,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([]); @@ -1210,7 +1262,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(); }); @@ -1218,23 +1270,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 @@ -1262,26 +1314,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([]); @@ -1294,21 +1346,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 @@ -1325,7 +1377,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); @@ -1335,10 +1387,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([]); @@ -1350,21 +1402,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 @@ -1379,7 +1431,7 @@ describe("Scene/I3SNode", function () { i3sGeometryData.meshData.meshes, i3sGeometryData.meshData.buffers, i3sGeometryData.meshData.bufferViews, - i3sGeometryData.meshData.accessors, + i3sGeometryData.meshData.accessors ); expect(rawGltf.textures).toBeDefined(); @@ -1393,7 +1445,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" ); }); }); @@ -1401,19 +1453,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 @@ -1428,7 +1480,7 @@ describe("Scene/I3SNode", function () { i3sGeometryData.meshData.meshes, i3sGeometryData.meshData.buffers, i3sGeometryData.meshData.bufferViews, - i3sGeometryData.meshData.accessors, + i3sGeometryData.meshData.accessors ); expect(rawGltf.textures).toBeDefined(); @@ -1442,19 +1494,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); @@ -1474,36 +1526,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() @@ -1513,7 +1565,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([]); @@ -1524,12 +1576,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); @@ -1548,12 +1600,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) { @@ -1561,7 +1613,7 @@ describe("Scene/I3SNode", function () { resource .getUrlComponent() .endsWith( - "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl", + "mockProviderUrl/mockLayerUrl/mockNodeUrl/mockFeatureDataUrl" ) ) { return Promise.reject({ statusCode: 404 }); @@ -1583,22 +1635,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(); @@ -1608,12 +1660,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 @@ -1642,17 +1694,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 @@ -1669,46 +1721,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 @@ -1725,41 +1777,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); @@ -1784,12 +1836,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); @@ -1814,7 +1866,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 () { @@ -1824,7 +1876,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); @@ -1867,7 +1919,7 @@ describe("Scene/I3SNode", function () { function () { childNode._tile._content = content; return Promise.resolve(content); - }, + } ); return childNode.tile.requestContent(); }) @@ -1886,7 +1938,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 () { @@ -1896,7 +1948,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); @@ -1942,7 +1994,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 () { @@ -1952,7 +2004,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); @@ -1998,12 +2050,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); @@ -2048,14 +2100,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); @@ -2099,14 +2151,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); @@ -2162,14 +2214,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 () { @@ -2179,7 +2231,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 () { @@ -2191,7 +2243,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( @@ -2200,17 +2252,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(); @@ -2221,12 +2273,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) ); }); @@ -2237,23 +2289,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(); @@ -2261,12 +2313,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 4e4d9f905760..e749db4fbca0 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 a129dd4ce0da..159d92a2a7a0 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 88a81e2fa6ac..426ecf48a0ba 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 5ec56fae243d..1ee0381faf21 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,21 +564,22 @@ 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(); @@ -613,17 +614,18 @@ describe( // triggers an exception (use of an undefined reference). const wholeWorldProvider = await SingleTileImageryProvider.fromUrl( - "Data/Images/Blue.png", + "Data/Images/Blue.png" + ); + const provider = await TileMapServiceImageryProvider.fromUrl( + "Data/TMS/SmallArea" ); - 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(); @@ -655,10 +657,11 @@ 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", + "Data/Images/Green4x4.png" + ); + const provider = await TileMapServiceImageryProvider.fromUrl( + "Data/TMS/SmallArea" ); - const provider = - await TileMapServiceImageryProvider.fromUrl("Data/TMS/SmallArea"); const layers = new ImageryLayerCollection(); layers.addImageryProvider(baseProvider); @@ -666,7 +669,7 @@ describe( const terrainProvider = new EllipsoidTerrainProvider(); const tiles = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme, + terrainProvider.tilingScheme ); tiles[0].data = new GlobeSurfaceTile(); tiles[1].data = new GlobeSurfaceTile(); @@ -678,52 +681,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); @@ -731,7 +734,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, { @@ -745,7 +748,7 @@ describe( const terrainProvider = new EllipsoidTerrainProvider(); const level0 = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme, + terrainProvider.tilingScheme ); const level1 = level0[0].children; const level2 = level1[0].children; @@ -781,7 +784,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, { @@ -790,7 +793,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); @@ -798,7 +801,7 @@ describe( const terrainProvider = new EllipsoidTerrainProvider(); const tiles = QuadtreeTile.createLevelZeroTiles( - terrainProvider.tilingScheme, + terrainProvider.tilingScheme ); tiles[0].data = new GlobeSurfaceTile(); tiles[1].data = new GlobeSurfaceTile(); @@ -821,5 +824,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/Implicit3DTileContentSpec.js b/packages/engine/Specs/Scene/Implicit3DTileContentSpec.js index 1f743ef08afc..b48e080ced12 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 8df69ce9626a..089d3a3de96e 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,15 +231,16 @@ 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({ @@ -418,7 +419,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); @@ -431,10 +432,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"); @@ -499,17 +500,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"); }); @@ -521,52 +522,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"); }); @@ -583,41 +584,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" ); }); @@ -626,14 +627,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 43983838d177..b1198d03251d 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 8a2ac96aa031..9cfafaac261a 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 9843af4215ad..7e275c53ae28 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,23 +344,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); @@ -372,20 +373,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 ); }); @@ -414,7 +415,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( @@ -422,14 +423,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); @@ -447,20 +448,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 ); }); @@ -485,13 +486,14 @@ 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); @@ -501,13 +503,13 @@ describe("Scene/ImplicitSubtree", function () { undefined, subtreeView, implicitQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability(subtree, subtreeDescription.contentAvailability); expectChildSubtreeAvailability( subtree, - subtreeDescription.childSubtreeAvailability, + subtreeDescription.childSubtreeAvailability ); }); @@ -532,24 +534,25 @@ 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); }); @@ -574,18 +577,19 @@ 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); }); @@ -615,19 +619,20 @@ 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(); }); @@ -651,21 +656,22 @@ 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 ); }); @@ -690,20 +696,21 @@ 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 ); }); @@ -727,14 +734,15 @@ 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); @@ -760,8 +768,9 @@ describe("Scene/ImplicitSubtree", function () { isInternal: true, }, }; - const results = - ImplicitTilingTester.generateSubtreeBuffers(subtreeDescription); + const results = ImplicitTilingTester.generateSubtreeBuffers( + subtreeDescription + ); const deeperQuadtreeCoordinates = new ImplicitTileCoordinates({ subdivisionScheme: implicitQuadtree.subdivisionScheme, @@ -776,7 +785,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - deeperQuadtreeCoordinates, + deeperQuadtreeCoordinates ); expect(function () { @@ -821,8 +830,9 @@ 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, @@ -835,7 +845,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - subtreeCoordinates, + subtreeCoordinates ); // level offset: 1, morton index: 0, so tile index is 1 + 0 = 1 @@ -850,11 +860,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 @@ -869,11 +879,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); }); @@ -897,8 +907,9 @@ 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, @@ -911,7 +922,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - deeperQuadtreeCoordinates, + deeperQuadtreeCoordinates ); expect(function () { @@ -956,8 +967,9 @@ 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, @@ -970,7 +982,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - subtreeCoordinates, + subtreeCoordinates ); const implicitCoordinatesFull = new ImplicitTileCoordinates({ @@ -986,7 +998,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({ @@ -1002,7 +1014,7 @@ describe("Scene/ImplicitSubtree", function () { expect(indexEmpty).toBe(3); expect(subtree.childSubtreeIsAvailableAtIndex(indexEmpty)).toEqual(false); expect( - subtree.childSubtreeIsAvailableAtCoordinates(implicitCoordinatesEmpty), + subtree.childSubtreeIsAvailableAtCoordinates(implicitCoordinatesEmpty) ).toEqual(false); }); @@ -1026,14 +1038,15 @@ 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 @@ -1062,20 +1075,21 @@ 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 ); }); @@ -1103,20 +1117,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 ); }); @@ -1140,10 +1154,11 @@ 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( @@ -1151,7 +1166,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, implicitQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); const bufferLoader = subtree._bufferLoader; expect(bufferLoader).toBeDefined(); @@ -1193,7 +1208,7 @@ describe("Scene/ImplicitSubtree", function () { multipleContentsQuadtree = new ImplicitTileset( tilesetResource, tileJson, - metadataSchema, + metadataSchema ); multipleContentsCoordinates = new ImplicitTileCoordinates({ @@ -1230,14 +1245,15 @@ 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; @@ -1272,10 +1288,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( @@ -1283,14 +1300,14 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsQuadtree, - multipleContentsCoordinates, + multipleContentsCoordinates ); expect(fetchExternal).toHaveBeenCalled(); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability( subtree, - subtreeDescription.contentAvailability, + subtreeDescription.contentAvailability ); }); @@ -1321,10 +1338,11 @@ 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( @@ -1332,14 +1350,14 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsQuadtree, - multipleContentsCoordinates, + multipleContentsCoordinates ); expect(fetchExternal).toHaveBeenCalled(); expectTileAvailability(subtree, subtreeDescription.tileAvailability); expectContentAvailability( subtree, - subtreeDescription.contentAvailability, + subtreeDescription.contentAvailability ); }); }); @@ -1500,31 +1518,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 ); }); @@ -1553,7 +1571,7 @@ describe("Scene/ImplicitSubtree", function () { metadataSubtreeJson, undefined, subtreeMetadataQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); const metadata = subtree.metadata; @@ -1592,17 +1610,18 @@ 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(); @@ -1613,10 +1632,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] ); } }); @@ -1647,17 +1666,18 @@ 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(); @@ -1668,10 +1688,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] ); } }); @@ -1702,17 +1722,18 @@ 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(); @@ -1726,10 +1747,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] ); } }); @@ -1760,17 +1781,18 @@ 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(); @@ -1784,10 +1806,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] ); } }); @@ -1823,17 +1845,18 @@ 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(); @@ -1847,10 +1870,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] ); } @@ -1860,10 +1883,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] ); } }); @@ -1899,17 +1922,18 @@ 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(); @@ -1923,10 +1947,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] ); } @@ -1936,10 +1960,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] ); } }); @@ -1970,11 +1994,12 @@ 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( @@ -1982,17 +2007,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] ); }); @@ -2022,11 +2047,12 @@ 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( @@ -2034,7 +2060,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, tileMetadataQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2077,11 +2103,12 @@ 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( @@ -2089,18 +2116,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] ); }); @@ -2130,11 +2157,12 @@ 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( @@ -2142,7 +2170,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, buildingMetadataQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2190,11 +2218,12 @@ 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( @@ -2202,7 +2231,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2216,14 +2245,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); @@ -2263,11 +2292,12 @@ 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( @@ -2275,7 +2305,7 @@ describe("Scene/ImplicitSubtree", function () { undefined, results.subtreeBuffer, multipleContentsMetadataQuadtree, - quadtreeCoordinates, + quadtreeCoordinates ); expect(fetchExternal).not.toHaveBeenCalled(); @@ -2289,13 +2319,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(); }); @@ -2327,17 +2357,18 @@ 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(); @@ -2351,10 +2382,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] ); } }); @@ -2386,17 +2417,18 @@ 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(); @@ -2407,10 +2439,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] ); } }); @@ -2462,14 +2494,15 @@ 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])); @@ -2479,10 +2512,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] ); } }); @@ -2516,15 +2549,16 @@ 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]; @@ -2540,10 +2574,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] ); } }); @@ -2585,15 +2619,16 @@ 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]; @@ -2612,10 +2647,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] ); } @@ -2625,10 +2660,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] ); } }); @@ -2713,17 +2748,18 @@ 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(); @@ -2731,13 +2767,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] ); } }); @@ -2823,17 +2859,18 @@ 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(); @@ -2841,13 +2878,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 5f941647832a..30d5c1e04f83 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 45684b9170db..9050f117205d 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 1311f00be47f..51b70891d303 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 4b8a589ac020..abde504d9040 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,25 +209,23 @@ 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 ); }); @@ -241,34 +239,32 @@ 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 ); }); @@ -276,24 +272,26 @@ 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 ); }); @@ -301,7 +299,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "TMS", { url: "http://test.invalid" }, - UrlTemplateImageryProvider, + UrlTemplateImageryProvider ); }); @@ -309,7 +307,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "URL_TEMPLATE", { url: "http://test.invalid" }, - UrlTemplateImageryProvider, + UrlTemplateImageryProvider ); }); @@ -317,7 +315,7 @@ describe("Scene/IonImageryProvider", function () { return testExternalImagery( "WMS", { url: "http://test.invalid", layers: [] }, - WebMapServiceImageryProvider, + WebMapServiceImageryProvider ); }); @@ -325,7 +323,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 ef8c86607285..9b6d39b99647 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 3f163690e81e..352e8fcfd822 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,8 +312,9 @@ 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 @@ -1108,7 +1109,7 @@ describe( scene.renderForSpecs(); expect(label.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1, + CesiumMath.EPSILON1 ); }); @@ -1124,7 +1125,7 @@ describe( expect(actual).toEqual(result); expect(result).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1, + CesiumMath.EPSILON1 ); }); @@ -1138,7 +1139,7 @@ describe( scene.renderForSpecs(); expect(label.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(1.0, 1.0), - CesiumMath.EPSILON1, + CesiumMath.EPSILON1 ); }); @@ -1152,7 +1153,7 @@ describe( scene.renderForSpecs(); expect(label.computeScreenSpacePosition(scene)).toEqualEpsilon( new Cartesian2(0.5, 0.5), - CesiumMath.EPSILON1, + CesiumMath.EPSILON1 ); }); @@ -1166,7 +1167,7 @@ describe( return allLabelsReady().then(function () { const bbox = Label.getScreenSpaceBoundingBox( label, - Cartesian2.ZERO, + Cartesian2.ZERO ); expect(bbox.x).toBeDefined(); expect(bbox.y).toBeDefined(); @@ -1189,7 +1190,7 @@ describe( const bbox = Label.getScreenSpaceBoundingBox( label, Cartesian2.ZERO, - result, + result ); expect(bbox.x).toBeDefined(); expect(bbox.y).toBeDefined(); @@ -1213,7 +1214,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); @@ -1232,7 +1233,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); @@ -1251,7 +1252,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); @@ -1387,14 +1388,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() ); } @@ -1459,10 +1460,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); @@ -1486,7 +1487,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, @@ -1596,7 +1597,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.translucencyByDistance).toEqual( - label.translucencyByDistance, + label.translucencyByDistance ); }); }); @@ -1609,7 +1610,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.pixelOffsetScaleByDistance).toEqual( - label.pixelOffsetScaleByDistance, + label.pixelOffsetScaleByDistance ); }); }); @@ -1633,7 +1634,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.translucencyByDistance).toEqual( - label.translucencyByDistance, + label.translucencyByDistance ); }); }); @@ -1646,7 +1647,7 @@ describe( getGlyphBillboards().forEach(function (billboard) { expect(billboard.pixelOffsetScaleByDistance).toEqual( - label.pixelOffsetScaleByDistance, + label.pixelOffsetScaleByDistance ); }); }); @@ -1689,13 +1690,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; @@ -1703,13 +1704,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 ); }); }); @@ -1733,30 +1734,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; @@ -1764,30 +1765,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 ); }); }); @@ -1810,22 +1811,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 @@ -1841,24 +1842,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; @@ -1866,24 +1867,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 ); }); }); @@ -1955,22 +1956,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)); }); }); @@ -2000,13 +2001,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) ); }); }); @@ -2089,14 +2090,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); @@ -2126,7 +2127,7 @@ describe( }); }); }, - "WebGL", + "WebGL" ); describe("right to left detection", function () { @@ -2322,15 +2323,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).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 cba4f0aebf7f..201da71b3e65 100644 --- a/packages/engine/Specs/Scene/MapboxImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/MapboxImageryProviderSpec.js @@ -51,18 +51,20 @@ 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(); @@ -77,18 +79,20 @@ 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(); @@ -104,7 +108,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); @@ -112,16 +116,18 @@ 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(); @@ -145,18 +151,20 @@ 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(); @@ -228,14 +236,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 @@ -267,22 +275,24 @@ 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(); @@ -297,22 +307,24 @@ 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 2bd1728922d8..a44d3c25c3e2 100644 --- a/packages/engine/Specs/Scene/MapboxStyleImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/MapboxStyleImageryProviderSpec.js @@ -51,18 +51,20 @@ 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(); @@ -77,18 +79,20 @@ 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(); @@ -104,7 +108,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); @@ -112,16 +116,18 @@ 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(); @@ -145,18 +151,20 @@ 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(); @@ -228,14 +236,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 @@ -266,18 +274,20 @@ 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); }); @@ -289,20 +299,22 @@ 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); }); @@ -314,20 +326,22 @@ 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); }); @@ -339,20 +353,22 @@ 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 bad1a970b4c4..014322fe88d0 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 9b940ef30994..53b0148ca38a 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,8 +494,22 @@ 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: { @@ -1049,5 +1063,5 @@ describe( material.destroy(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/MegatextureSpec.js b/packages/engine/Specs/Scene/MegatextureSpec.js index 1e191000f158..9074e86898cf 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 4f2f2ca37129..7e79fb403d0d 100644 --- a/packages/engine/Specs/Scene/MetadataClassPropertySpec.js +++ b/packages/engine/Specs/Scene/MetadataClassPropertySpec.js @@ -460,7 +460,15 @@ 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({ @@ -474,7 +482,24 @@ 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, ]); }); @@ -829,7 +854,7 @@ describe("Scene/MetadataClassProperty", function () { const value = scalarValues[propertyId][i]; const normalizedValue = property.normalize(value); expect(normalizedValue).toEqual( - normalizedScalarValues[propertyId][i], + normalizedScalarValues[propertyId][i] ); } } @@ -869,7 +894,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] ); } } @@ -905,7 +930,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] ); } } @@ -941,7 +966,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] ); } } @@ -1413,7 +1438,7 @@ describe("Scene/MetadataClassProperty", function () { const value = scalarValues[propertyId][i]; const transformedValue = property.applyValueTransform(value); expect(transformedValue).toEqual( - transformedScalarValues[propertyId][i], + transformedScalarValues[propertyId][i] ); } } @@ -1458,7 +1483,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", @@ -1484,10 +1509,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] ); } } @@ -1505,7 +1530,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]); } @@ -1516,7 +1541,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({ @@ -1534,7 +1559,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(); @@ -1551,10 +1576,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] ); } } @@ -1572,7 +1597,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]); } @@ -1591,10 +1616,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] ); } } @@ -1613,7 +1638,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]); } @@ -2597,7 +2622,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(); }); @@ -2617,7 +2642,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(); }); @@ -2632,7 +2657,7 @@ describe("Scene/MetadataClassProperty", function () { }); expect(property.validate(undefined)).toBe( - "required property must have a value", + "required property must have a value" ); }); @@ -2674,7 +2699,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" ); }); @@ -2688,7 +2713,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" ); }); @@ -2768,7 +2793,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" ); }); @@ -2805,10 +2830,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" ); }); @@ -2835,7 +2860,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]}` ); } }); @@ -2848,7 +2873,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` ); }); @@ -2860,7 +2885,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` ); }); @@ -2899,7 +2924,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}` ); } } @@ -2940,7 +2965,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` ); } } @@ -2982,7 +3007,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}` ); } } @@ -3009,16 +3034,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)" ); }); @@ -3031,7 +3056,7 @@ describe("Scene/MetadataClassProperty", function () { value, offset, scale, - MetadataComponentType.applyValueTransform, + MetadataComponentType.applyValueTransform ); expect(result).toBe(3); @@ -3045,7 +3070,7 @@ describe("Scene/MetadataClassProperty", function () { value, offset, scale, - MetadataComponentType.applyValueTransform, + MetadataComponentType.applyValueTransform ); expect(result).toEqual([3, 4, 5]); }); @@ -3070,7 +3095,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 025792cccabb..3bb720dff7e1 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,38 +178,34 @@ 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); }); @@ -275,7 +271,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]); } @@ -293,7 +289,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]); } @@ -385,7 +381,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]); } @@ -410,7 +406,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]); } @@ -418,16 +414,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); }); @@ -451,34 +447,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); }); @@ -496,34 +492,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); }); @@ -535,40 +531,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 a8bb15476fb0..eb87dd915744 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,18 +518,13 @@ 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]; @@ -538,14 +533,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 @@ -557,7 +552,7 @@ describe("Scene/MetadataEntity", function () { undefined, "Building B", properties, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -568,7 +563,7 @@ describe("Scene/MetadataEntity", function () { "name", undefined, properties, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -579,7 +574,7 @@ describe("Scene/MetadataEntity", function () { "name", "Building B", undefined, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -595,14 +590,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"); }); @@ -611,7 +606,7 @@ describe("Scene/MetadataEntity", function () { MetadataEntity.getPropertyBySemantic( undefined, properties, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -634,11 +629,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"); }); @@ -648,8 +643,8 @@ describe("Scene/MetadataEntity", function () { "HEIGHT", 20.0, properties, - classDefinition, - ), + classDefinition + ) ).toBe(false); }); @@ -659,7 +654,7 @@ describe("Scene/MetadataEntity", function () { undefined, "Building B", properties, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -670,7 +665,7 @@ describe("Scene/MetadataEntity", function () { "NAME", undefined, properties, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -681,7 +676,7 @@ describe("Scene/MetadataEntity", function () { "NAME", "Building B", undefined, - classDefinition, + classDefinition ); }).toThrowDeveloperError(); }); @@ -692,7 +687,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 4ead1809dc3f..9c14c187e943 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 1d64a16bc1d0..a6ddddbb5ace 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,8 +377,13 @@ 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 77f5ec24b80f..9cb1721620f0 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 de6ed67e7d2d..120bf89679ad 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 02a065f4365d..753fbcbcb5e8 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 9267f6a15df6..7933375ca4b1 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 71d50413c106..fc9e95c69f56 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 ad73f3aa26c8..63fb2545ce9c 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 adfa295c7948..6df7bf6333e6 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 d62b7184c13c..dc30239df431 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 a2e8a6797800..cf674eee8c16 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 03c8b3698168..669b4ab404a5 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 47cef0858305..c8eed6be5bd5 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,11 +125,9 @@ 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 = { @@ -137,20 +135,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 ), }; @@ -182,11 +180,9 @@ 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(), }; @@ -197,24 +193,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 ), }; @@ -244,24 +240,22 @@ 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 ), }; @@ -290,12 +284,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/Extensions/Gpm/GltfGpmLoaderSpec.js b/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfGpmLoaderSpec.js index ddaf8ddfb390..6a4178441d26 100644 --- a/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfGpmLoaderSpec.js +++ b/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfGpmLoaderSpec.js @@ -62,8 +62,8 @@ describe("Scene/Model/Extensions/Gpm/GltfGpmLoader", function () { Cartesian3.equalsEpsilon( actualAnchorPoint.position, expectedPosition, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); const expectedAdjustmentParams = new Cartesian3(0.1, 0.2, 0.3); @@ -71,21 +71,21 @@ describe("Scene/Model/Extensions/Gpm/GltfGpmLoader", function () { Cartesian3.equalsEpsilon( actualAnchorPoint.adjustmentParams, expectedAdjustmentParams, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); const expectedCovarianceDirect = Matrix3.fromArray( [0.1, 0.2, 0.4, 0.2, 0.3, 0.5, 0.4, 0.5, 0.6], 0, - new Matrix3(), + new Matrix3() ); expect( Matrix3.equalsEpsilon( result.covarianceDirect, expectedCovarianceDirect, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); }); @@ -151,8 +151,8 @@ describe("Scene/Model/Extensions/Gpm/GltfGpmLoader", function () { Cartesian3.equalsEpsilon( actualAnchorPoint.position, expectedPosition, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); const expectedAdjustmentParams = new Cartesian3(0.1, 0.2, 0.3); @@ -160,21 +160,21 @@ describe("Scene/Model/Extensions/Gpm/GltfGpmLoader", function () { Cartesian3.equalsEpsilon( actualAnchorPoint.adjustmentParams, expectedAdjustmentParams, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); const expectedCovarianceMatrix = Matrix3.fromArray( [0.1, 0.2, 0.4, 0.2, 0.3, 0.5, 0.4, 0.5, 0.6], 0, - new Matrix3(), + new Matrix3() ); expect( Matrix3.equalsEpsilon( actualAnchorPoint.covarianceMatrix, expectedCovarianceMatrix, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); expect(result.intraTileCorrelationGroups.length).toBe(1); @@ -188,8 +188,8 @@ describe("Scene/Model/Extensions/Gpm/GltfGpmLoader", function () { Cartesian3.equalsEpsilon( correlationGroup.rotationThetas, expectedRotationThetas, - CesiumMath.EPSILON6, - ), + CesiumMath.EPSILON6 + ) ).toBeTrue(); const params = correlationGroup.params; diff --git a/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoaderSpec.js b/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoaderSpec.js index b68aa8a9f834..81591889fbdc 100644 --- a/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoaderSpec.js +++ b/packages/engine/Specs/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoaderSpec.js @@ -103,7 +103,8 @@ function createEmbeddedGltf(gpmExtension) { }, buffers: [ { - uri: "data:application/gltf-buffer;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAA", + uri: + "data:application/gltf-buffer;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAA", byteLength: 156, }, ], @@ -124,7 +125,8 @@ function createEmbeddedGltf(gpmExtension) { ], images: [ { - uri: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABs0lEQVR42hXMUwCWBwBA0b8Wlo1lLHNt2a4tLZtbrdZatm1jWcu2bSxrtWq1Zds438O5jzcUCoU+hSEsXxCO8EQgIl8SichEISrRiE4MQjElFrGJQ1ziEZ8EJOQrEpGYJCQlGcmDQQpJSSpS8zVpSEs60pOBjGQiM1nISrZgkF2+IQff8h05yUVu8pCXfOSnAAUpROFgUESKUozilKAkpShNGcryPT9QjvJUoGIwqCQ/UpkqVKUa1alBTWpRmzrUpR71aRAMGkojGtOEn/iZpjTjF5rTgl9pyW+04vdg0Fra0JZ2tKcDHelEZ7rQlW50pwc96RUMeksf+tKP/gxgIIMYzBCGMozhjGAko4LBaBnDWMYxnglMZBJ/MJkpTGUa05nBzGAwS2Yzh7n8yTzms4CFLGIxS1jKMpazIhislFWsZg1rWcd6NrCRTWxmC1vZxnZ2BIOdsovd7GEv+9jPAQ5yiMMc4Sh/cYzjweCEnOQUpznDWc5xngv8zUUu8Q+XucLVYPCvXOM6//E/N7jJLW5zh7vc4z4PeMijYPBYnvCUZzznBS95xWve8JZ3vOcDH/nEZ7gvfpBCxLDKAAAAAElFTkSuQmCC", + uri: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABs0lEQVR42hXMUwCWBwBA0b8Wlo1lLHNt2a4tLZtbrdZatm1jWcu2bSxrtWq1Zds438O5jzcUCoU+hSEsXxCO8EQgIl8SichEISrRiE4MQjElFrGJQ1ziEZ8EJOQrEpGYJCQlGcmDQQpJSSpS8zVpSEs60pOBjGQiM1nISrZgkF2+IQff8h05yUVu8pCXfOSnAAUpROFgUESKUozilKAkpShNGcryPT9QjvJUoGIwqCQ/UpkqVKUa1alBTWpRmzrUpR71aRAMGkojGtOEn/iZpjTjF5rTgl9pyW+04vdg0Fra0JZ2tKcDHelEZ7rQlW50pwc96RUMeksf+tKP/gxgIIMYzBCGMozhjGAko4LBaBnDWMYxnglMZBJ/MJkpTGUa05nBzGAwS2Yzh7n8yTzms4CFLGIxS1jKMpazIhislFWsZg1rWcd6NrCRTWxmC1vZxnZ2BIOdsovd7GEv+9jPAQ5yiMMc4Sh/cYzjweCEnOQUpznDWc5xngv8zUUu8Q+XucLVYPCvXOM6//E/N7jJLW5zh7vc4z4PeMijYPBYnvCUZzznBS95xWve8JZ3vOcDH/nEZ7gvfpBCxLDKAAAAAElFTkSuQmCC", mimeType: "image/png", }, ], @@ -361,7 +363,7 @@ describe( const destroyTexture = spyOn( GltfTextureLoader.prototype, - "destroy", + "destroy" ).and.callThrough(); const loader = new GltfMeshPrimitiveGpmLoader({ @@ -393,7 +395,7 @@ describe( const destroyTexture = spyOn( GltfTextureLoader.prototype, - "destroy", + "destroy" ).and.callThrough(); const loader = new GltfMeshPrimitiveGpmLoader({ @@ -423,5 +425,5 @@ describe( return resolveAfterDestroy(true); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/Model/FeatureIdPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/FeatureIdPipelineStageSpec.js index 91a653a3a154..889c6e5c2eca 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 5edd68d8acdf..adb5ca1b8bd1 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 57d9e3794a1f..cc34a4795f4b 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,35 +188,31 @@ 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;", @@ -228,7 +224,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - [], + [] ); verifyFeatureStruct(shaderBuilder); }); @@ -242,7 +238,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -255,7 +251,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); @@ -265,7 +261,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); @@ -275,7 +271,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); @@ -284,11 +280,7 @@ 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, @@ -300,7 +292,7 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -310,19 +302,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;", @@ -342,7 +334,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); }); @@ -361,7 +353,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene2D.frameState, + scene2D.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -377,7 +369,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); @@ -385,11 +377,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(); @@ -406,7 +398,7 @@ describe( " vec3 position2D;", " vec3 normalMC;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -417,7 +409,7 @@ describe( " attributes.position2D = a_position2D;", " attributes.normalMC = a_normalMC;", " attributes.texCoord_0 = a_texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -430,7 +422,7 @@ describe( "in vec3 a_position2D;", "in vec3 a_normalMC;", "in vec2 a_texCoord_0;", - ], + ] ); verifyFeatureStruct(shaderBuilder); }); @@ -445,7 +437,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -458,7 +450,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); @@ -468,7 +460,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); @@ -478,7 +470,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); @@ -488,7 +480,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); @@ -504,7 +496,7 @@ describe( " float tangentSignMC;", " vec3 bitangentMC;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -518,7 +510,7 @@ describe( " vec3 tangentEC;", " vec3 bitangentEC;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -530,19 +522,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;", @@ -572,7 +564,7 @@ describe( "in vec3 a_normalMC;", "in vec4 a_tangentMC;", "in vec2 a_texCoord_0;", - ], + ] ); verifyFeatureStruct(shaderBuilder); }); @@ -587,7 +579,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -600,7 +592,7 @@ describe( expect(positionAttribute.vertexBuffer).toBeDefined(); expect(positionAttribute.componentsPerAttribute).toEqual(3); expect(positionAttribute.componentDatatype).toEqual( - ComponentDatatype.FLOAT, + ComponentDatatype.FLOAT ); const texCoord0Attribute = attributes[1]; @@ -608,7 +600,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); @@ -618,7 +610,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); @@ -631,7 +623,7 @@ describe( " vec3 positionMC;", " vec2 texCoord_0;", " vec2 texCoord_1;", - ], + ] ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -643,7 +635,7 @@ describe( " vec3 positionEC;", " vec2 texCoord_0;", " vec2 texCoord_1;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -653,7 +645,7 @@ describe( " attributes.positionMC = a_positionMC;", " attributes.texCoord_0 = a_texCoord_0;", " attributes.texCoord_1 = a_texCoord_1;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -662,7 +654,7 @@ describe( [ " v_texCoord_0 = attributes.texCoord_0;", " v_texCoord_1 = attributes.texCoord_1;", - ], + ] ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -671,7 +663,7 @@ describe( [ " attributes.texCoord_0 = v_texCoord_0;", " attributes.texCoord_1 = v_texCoord_1;", - ], + ] ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec2 v_texCoord_0;", @@ -691,7 +683,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); }); @@ -706,7 +698,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -719,7 +711,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); @@ -729,7 +721,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); @@ -739,7 +731,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); @@ -749,7 +741,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); @@ -763,7 +755,7 @@ describe( " vec3 normalMC;", " vec4 color_0;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -776,7 +768,7 @@ describe( " vec3 normalEC;", " vec4 color_0;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -787,7 +779,7 @@ describe( " attributes.normalMC = a_normalMC;", " attributes.color_0 = a_color_0;", " attributes.texCoord_0 = a_texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -796,7 +788,7 @@ describe( [ " v_color_0 = attributes.color_0;", " v_texCoord_0 = attributes.texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasFragmentFunctionUnordered( shaderBuilder, @@ -805,7 +797,7 @@ describe( [ " attributes.color_0 = v_color_0;", " attributes.texCoord_0 = v_texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVaryings(shaderBuilder, [ "vec3 v_normalEC;", @@ -828,11 +820,7 @@ 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); }); @@ -847,7 +835,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -860,7 +848,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); @@ -870,7 +858,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); @@ -879,7 +867,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, @@ -890,7 +878,7 @@ describe( " vec3 positionWC;", " vec3 positionEC;", " vec4 color_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -899,19 +887,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;", @@ -930,7 +918,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec4 a_color_0;"], + ["in vec4 a_color_0;"] ); verifyFeatureStruct(shaderBuilder); }); @@ -942,7 +930,7 @@ describe( GeometryPipelineStage.process( renderResources, customAttributePrimitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -955,7 +943,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); @@ -965,7 +953,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); @@ -974,7 +962,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, @@ -985,7 +973,7 @@ describe( " vec3 positionWC;", " vec3 positionEC;", " vec2 temperature;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -994,19 +982,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;", @@ -1017,7 +1005,7 @@ describe( ShaderBuilderTester.expectHasAttributes( shaderBuilder, "in vec3 a_positionMC;", - ["in vec2 a_temperature;"], + ["in vec2 a_temperature;"] ); verifyFeatureStruct(shaderBuilder); }); @@ -1031,7 +1019,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -1044,7 +1032,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); @@ -1054,7 +1042,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); @@ -1064,7 +1052,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); @@ -1077,7 +1065,7 @@ describe( " vec3 positionMC;", " vec3 normalMC;", " float featureId_0;", - ], + ] ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1089,7 +1077,7 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " float featureId_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -1099,12 +1087,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", @@ -1127,7 +1115,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -1140,7 +1128,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); @@ -1150,7 +1138,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); @@ -1159,7 +1147,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, @@ -1170,7 +1158,7 @@ describe( " vec3 positionWC;", " vec3 positionEC;", " float featureId_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexFunctionUnordered( shaderBuilder, @@ -1179,12 +1167,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", @@ -1207,7 +1195,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -1220,7 +1208,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(); @@ -1230,7 +1218,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(); @@ -1240,7 +1228,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(); @@ -1249,11 +1237,7 @@ 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, @@ -1265,19 +1249,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", @@ -1301,7 +1285,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene.frameState, + scene.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -1314,7 +1298,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(); @@ -1324,7 +1308,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(); @@ -1334,7 +1318,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(); @@ -1344,7 +1328,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(); @@ -1360,7 +1344,7 @@ describe( " float tangentSignMC;", " vec3 bitangentMC;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1374,7 +1358,7 @@ describe( " vec3 tangentEC;", " vec3 bitangentEC;", " vec2 texCoord_0;", - ], + ] ); // Initialization is skipped for dequantized attributes ShaderBuilderTester.expectHasVertexFunctionUnordered( @@ -1384,7 +1368,7 @@ describe( [ " attributes.tangentMC = a_tangentMC.xyz;", " attributes.tangentSignMC = a_tangentMC.w;", - ], + ] ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, @@ -1393,7 +1377,7 @@ describe( "in vec2 a_quantized_normalMC;", "in vec2 a_quantized_texCoord_0;", "in vec4 a_tangentMC;", - ], + ] ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_BITANGENTS", @@ -1422,7 +1406,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene2D.frameState, + scene2D.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -1435,7 +1419,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(); @@ -1445,7 +1429,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(); @@ -1455,7 +1439,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(); @@ -1465,7 +1449,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(); @@ -1479,7 +1463,7 @@ describe( " vec3 position2D;", " vec3 normalMC;", " vec2 texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasFragmentStruct( shaderBuilder, @@ -1491,7 +1475,7 @@ describe( " vec3 positionEC;", " vec3 normalEC;", " vec2 texCoord_0;", - ], + ] ); // While initialization is skipped for dequantized attributes, @@ -1500,7 +1484,7 @@ describe( shaderBuilder, GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES, GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES, - [" attributes.position2D = a_position2D;"], + [" attributes.position2D = a_position2D;"] ); ShaderBuilderTester.expectHasAttributes( shaderBuilder, @@ -1509,7 +1493,7 @@ describe( "in vec3 a_position2D;", "in vec2 a_quantized_normalMC;", "in vec2 a_quantized_texCoord_0;", - ], + ] ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -1523,171 +1507,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 () { @@ -1703,7 +1687,7 @@ describe( GeometryPipelineStage.process( renderResources, primitive, - scene2D.frameState, + scene2D.frameState ); const shaderBuilder = renderResources.shaderBuilder; @@ -1719,7 +1703,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); @@ -1730,11 +1714,7 @@ 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, @@ -1743,7 +1723,7 @@ describe( [ " attributes.positionMC = a_positionMC;", " attributes.normalMC = a_normalMC;", - ], + ] ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ "HAS_NORMALS", @@ -1751,11 +1731,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 7237c8ae1dc3..a23fae09288c 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 9c3f32e422ed..cc2c3bf9ce1f 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 73077d44a515..bc739a877da7 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); - expect(renderResources.attributes.length).toBe(1); + InstancingPipelineStage.process( + renderResources, + node, + scene.frameState + ); - const runtimeNode = renderResources.runtimeNode; - expect(runtimeNode.instancingTranslationMax).toEqual( - new Cartesian3(2, 2, 0), - ); - expect(runtimeNode.instancingTranslationMin).toEqual( - new Cartesian3(-2, -2, 0), - ); + expect(renderResources.attributes.length).toBe(1); - // Ensure that the max / min are still defined after the stage is re-run. - InstancingPipelineStage.process( - renderResources, - node, - scene.frameState, - ); + const runtimeNode = renderResources.runtimeNode; + expect(runtimeNode.instancingTranslationMax).toEqual( + new Cartesian3(2, 2, 0) + ); + expect(runtimeNode.instancingTranslationMin).toEqual( + new Cartesian3(-2, -2, 0) + ); - expect(runtimeNode.instancingTranslationMin).toEqual( - new Cartesian3(-2, -2, 0), - ); - expect(runtimeNode.instancingTranslationMax).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 + ); + + 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,33 +357,71 @@ 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 ); } }); @@ -395,85 +433,96 @@ 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, - ); + return loadGltf(boxInstancedTranslationMinMax).then(function ( + gltfLoader + ) { + const components = gltfLoader.components; + const node = components.nodes[0]; + const renderResources = mockRenderResources(node); - 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); - }, - ); + 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); + + // 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 () { @@ -487,14 +536,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(); @@ -542,14 +591,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(); @@ -578,12 +627,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); @@ -613,14 +662,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) ), }, }; @@ -641,7 +690,7 @@ describe( InstancingPipelineStage.process( renderResources, node, - scene.frameState, + scene.frameState ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -673,18 +722,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. @@ -695,11 +744,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. @@ -707,5 +756,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/Model/MaterialPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/MaterialPipelineStageSpec.js index 128eef15b282..f7dd44fefae7 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,12 +471,15 @@ 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, @@ -832,7 +835,7 @@ describe( uniformMap, textureReader, "u_testTexture", - "TEST", + "TEST" ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); @@ -864,7 +867,7 @@ describe( textureReader, "u_testTexture", "TEST", - mockFrameState.context.defaultTexture, + mockFrameState.context.defaultTexture ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, []); @@ -899,7 +902,7 @@ describe( textureReader, "u_testTexture", "TEST", - mockFrameState.context.defaultTexture, + mockFrameState.context.defaultTexture ); expectUniformMap(uniformMap, { @@ -907,5 +910,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/Model/MetadataPipelineStageSpec.js b/packages/engine/Specs/Scene/Model/MetadataPipelineStageSpec.js index a873646d0dab..8600d2edef03 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 289dc253d350..1aa9a724e95c 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 b03ffb438fd1..20070d210ee7 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 b6c1f392a4e6..cc938fab9721 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 045d5d33c025..12d2b936b02a 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 804d78bec6e3..4cc07a260bd3 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 490e94330f9a..13e8be131b3d 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 d51edda0f504..734a88a3b433 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 964c0990130c..756d865e8688 100644 --- a/packages/engine/Specs/Scene/Model/ModelClippingPolygonsPipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/ModelClippingPolygonsPipelineStageSpec.js @@ -14,8 +14,12 @@ 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; @@ -65,7 +69,7 @@ describe("Scene/Model/ModelClippingPolygonsPipelineStage", function () { ModelClippingPolygonsPipelineStage.process( renderResources, model, - mockFrameState, + mockFrameState ); ShaderBuilderTester.expectHasVertexDefines(shaderBuilder, [ @@ -128,7 +132,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 4d1ac96a7d19..d68bec1590c9 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 565e227470e5..6e86f1b0f1b6 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 d16cd5128f5a..ee195d8ce093 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 34d699423f47..17ffae777fe4 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 6fe8cf58d8ed..26c843b4c6fd 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 6f73a0ca076c..7bf4f8a1c3b6 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 147536b015b8..8de1acdc3ee6 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 243c07aff70c..a25da3380d4b 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 aa4f099a657a..8a6386bd7c18 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 daa00cf38fde..f29424fc5587 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 e3a9377cf475..82b547bd50d6 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 55f1d221e752..2c97e91d328f 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 704f92620a1d..d900e93dbbd8 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 e1a0a7235c96..5e44cd7e1c69 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 f3ac4d570a39..5fec3e9e9999 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, }, - isBatched, - ); + secondaryColor: { + type: MetadataType.VEC3, + componentType: MetadataComponentType.FLOAT32, + }, + id: { + type: MetadataType.SCALAR, + componentType: MetadataComponentType.UINT16, + }, + }, + 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, }, - isBatched, - ); + secondaryColor: { + type: MetadataType.VEC3, + componentType: MetadataComponentType.FLOAT32, + }, + id: { + type: MetadataType.SCALAR, + componentType: MetadataComponentType.UINT16, + }, + }, + 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 11cf22014bd7..d2fb924c6212 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 30887321fc9d..213612f94c55 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,8 +179,10 @@ 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); @@ -212,8 +214,10 @@ 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); @@ -260,8 +264,10 @@ 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); @@ -291,5 +297,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 1e3a0ace79e9..74a50168138d 100644 --- a/packages/engine/Specs/Scene/Model/PrimitiveOutlineGeneratorSpec.js +++ b/packages/engine/Specs/Scene/Model/PrimitiveOutlineGeneratorSpec.js @@ -392,7 +392,15 @@ 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([ @@ -503,5 +511,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/Model/PrimitiveOutlinePipelineStageSpec.js b/packages/engine/Specs/Scene/Model/PrimitiveOutlinePipelineStageSpec.js index 02244c9a321c..fa37b883cca6 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 740e9218f0c0..ab230b293574 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 92bf3249675b..54c2840a8f33 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 17ea371b8ea6..e5998f7f031e 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 dae4030ca0fc..afa2f5da13d7 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 f89b84b59e6e..4449c281bfdb 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 e5a12e3cf69e..2bd470f93417 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 0d8c853f3370..1cee84bf1cf0 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 aa17f40a821f..da7e17dceec3 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 0dc90b162939..0eead95983fe 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 9287f87ec935..5cf9183b999c 100644 --- a/packages/engine/Specs/Scene/Model/WireframePipelineStageSpec.js +++ b/packages/engine/Specs/Scene/Model/WireframePipelineStageSpec.js @@ -87,27 +87,23 @@ 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 () { @@ -115,72 +111,64 @@ 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 2a17f97533a4..2c80710f8a4c 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 9a8ad02fab38..02dc9d73d8f7 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 1da140c7caba..6b5f2201bec1 100644 --- a/packages/engine/Specs/Scene/MoonSpec.js +++ b/packages/engine/Specs/Scene/MoonSpec.js @@ -32,14 +32,13 @@ 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) ); } @@ -81,5 +80,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 f981a3de2845..5c417c6f4a7a 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,17 +253,18 @@ 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, @@ -295,7 +296,7 @@ describe( ? new BoundingSphere(Cartesian3.clone(Cartesian3.ZERO), 500000.0) : undefined, pass: Pass.OPAQUE, - }), + }) ); }; @@ -374,5 +375,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/Multiple3DTileContentSpec.js b/packages/engine/Specs/Scene/Multiple3DTileContentSpec.js index 5682ba42c43c..7e84bd96d4e2 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 238e58b117cf..b097f2c020e1 100644 --- a/packages/engine/Specs/Scene/OpenStreetMapImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/OpenStreetMapImageryProviderSpec.js @@ -46,18 +46,20 @@ 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(); @@ -70,18 +72,20 @@ 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(); @@ -94,18 +98,20 @@ 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(); @@ -125,16 +131,18 @@ 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(); @@ -170,34 +178,36 @@ 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(); @@ -227,18 +237,20 @@ 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(); @@ -267,14 +279,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 @@ -303,7 +315,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 5b25e9c092bd..2a7a27462337 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 fa38951f7125..288934593706 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 9f9e8207c87e..663913967c99 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 42b4bdc401c7..362fb4ca53b6 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,14 +243,15 @@ 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)); }); @@ -264,10 +265,11 @@ 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); @@ -383,7 +385,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); expect(scene).toDrillPickAndCall(function (pickedObjects) { @@ -421,7 +423,7 @@ describe( geometryInstances: [instance1, instance2], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); expect(scene).toDrillPickAndCall(function (pickedObjects) { @@ -465,7 +467,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); expect(scene).toDrillPickAndCall(function (pickedObjects) { @@ -531,7 +533,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); @@ -550,7 +552,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); } }, primitiveRay); @@ -599,7 +601,7 @@ describe( expect(result.object.primitive).toBe(rectangle1); }, primitiveRay, - [rectangle2, rectangle3, rectangle4], + [rectangle2, rectangle3, rectangle4] ); // Tests that rectangle4 does not get un-hidden @@ -621,7 +623,7 @@ describe( }, primitiveRay, [], - 0.01, + 0.01 ); }); @@ -633,7 +635,7 @@ describe( }, primitiveRay, [], - 0.1, + 0.1 ); expect(scene).toPickFromRayAndCall( function (result) { @@ -641,7 +643,7 @@ describe( }, primitiveRay, [], - 1.0, + 1.0 ); }); @@ -681,7 +683,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); } else { expect(position).toBeUndefined(); @@ -704,11 +706,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(); @@ -789,7 +791,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); expect(scene).toDrillPickFromRayAndCall(function (results) { @@ -827,7 +829,7 @@ describe( geometryInstances: [instance1, instance2], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); expect(scene).toDrillPickFromRayAndCall(function (results) { @@ -871,7 +873,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); expect(scene).toDrillPickFromRayAndCall(function (results) { @@ -895,7 +897,7 @@ describe( expect(results[2].object.primitive).toEqual(rectangle2); }, primitiveRay, - 3, + 3 ); }); @@ -913,7 +915,7 @@ describe( }, primitiveRay, 2, - [rectangle5, rectangle3], + [rectangle5, rectangle3] ); }); @@ -925,7 +927,7 @@ describe( }, primitiveRay, [], - 0.1, + 0.1 ); expect(scene).toDrillPickFromRayAndCall( function (result) { @@ -934,7 +936,7 @@ describe( primitiveRay, Number.POSITIVE_INFINITY, [], - 1.0, + 1.0 ); }); @@ -1036,7 +1038,7 @@ describe( expect(height).toEqualEpsilon(0.0, CesiumMath.EPSILON3); }, cartographic, - [rectangle2, rectangle3], + [rectangle2, rectangle3] ); }); @@ -1081,7 +1083,7 @@ describe( }, cartographic, [], - 0.1, + 0.1 ); expect(scene).toSampleHeightAndCall( function (height) { @@ -1089,7 +1091,7 @@ describe( }, cartographic, [], - 1.0, + 1.0 ); }); @@ -1186,7 +1188,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }, cartesian); }); @@ -1203,7 +1205,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0, 1.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }, cartesian); }); @@ -1234,11 +1236,11 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }, cartesian, - [rectangle2, rectangle3], + [rectangle2, rectangle3] ); }); @@ -1257,7 +1259,7 @@ describe( expect(scene).toClampToHeightAndCall(function (clampedCartesian) { expect(clampedCartesian).toEqualEpsilon( cartesian, - CesiumMath.EPSILON3, + CesiumMath.EPSILON3 ); }, cartesian); @@ -1265,7 +1267,7 @@ describe( expect(scene).toClampToHeightAndCall(function (clampedCartesian) { expect(clampedCartesian).toEqualEpsilon( cartesian, - CesiumMath.EPSILON3, + CesiumMath.EPSILON3 ); }, cartesian); @@ -1288,7 +1290,7 @@ describe( }, cartesian, [], - 0.1, + 0.1 ); expect(scene).toClampToHeightAndCall( function (clampedCartesian) { @@ -1296,7 +1298,7 @@ describe( }, cartesian, [], - 1.0, + 1.0 ); }); @@ -1456,7 +1458,7 @@ describe( const objectsToExclude = [tileset]; const result = await pickFromRayMostDetailed( primitiveRay, - objectsToExclude, + objectsToExclude ); expect(result).toBeUndefined(); }); @@ -1488,7 +1490,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); } }); @@ -1602,7 +1604,7 @@ describe( const expectedPosition = Cartesian3.fromRadians(0.0, 0.0); expect(position).toEqualEpsilon( expectedPosition, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); } else { expect(position).toBeUndefined(); @@ -1628,11 +1630,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(); @@ -1724,7 +1726,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); scene.camera.setView({ destination: offscreenRectangle }); @@ -1765,7 +1767,7 @@ describe( geometryInstances: [instance1, instance2], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); scene.camera.setView({ destination: offscreenRectangle }); @@ -1812,7 +1814,7 @@ describe( geometryInstances: [instance1, instance2, instance3], asynchronous: false, appearance: new EllipsoidSurfaceAppearance(), - }), + }) ); scene.camera.setView({ destination: offscreenRectangle }); @@ -1867,14 +1869,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); }); @@ -1908,8 +1910,9 @@ 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 @@ -1931,8 +1934,9 @@ 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; @@ -1956,8 +1960,9 @@ 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(); }); @@ -1975,8 +1980,9 @@ 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 @@ -1994,8 +2000,9 @@ 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; @@ -2013,11 +2020,12 @@ 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 ); }); @@ -2038,12 +2046,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 }); @@ -2063,17 +2071,18 @@ 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); @@ -2091,13 +2100,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(); }); @@ -2108,8 +2117,9 @@ describe( } const cartographics = []; - const updatedCartographics = - await sampleHeightMostDetailed(cartographics); + const updatedCartographics = await sampleHeightMostDetailed( + cartographics + ); expect(updatedCartographics.length).toBe(0); }); @@ -2264,7 +2274,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]; @@ -2283,7 +2293,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0, 1.0); expect(updatedCartesians[0]).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }); @@ -2307,12 +2317,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 }); @@ -2338,13 +2348,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); @@ -2363,13 +2373,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(); }); @@ -2444,10 +2454,14 @@ describe( createSmallRectangle(0.0); const offscreenRectanglePrimitive = createRectangle( 0.0, - offscreenRectangle, + offscreenRectangle + ); + offscreenRectanglePrimitive.appearance.material.uniforms.color = new Color( + 1.0, + 0.0, + 0.0, + 1.0 ); - offscreenRectanglePrimitive.appearance.material.uniforms.color = - new Color(1.0, 0.0, 0.0, 1.0); scene.camera.setView({ destination: offscreenRectangle }); @@ -2464,18 +2478,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 ); }); @@ -2484,7 +2498,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }, cartesian); @@ -2496,13 +2510,17 @@ 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(); @@ -2513,7 +2531,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }, cartesian); @@ -2522,11 +2540,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 ); }); @@ -2551,7 +2569,7 @@ describe( const expectedCartesian = Cartesian3.fromRadians(0.0, 0.0); expect(cartesian).toEqualEpsilon( expectedCartesian, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }, cartesian); @@ -2565,5 +2583,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/PointCloudEyeDomeLightingSpec.js b/packages/engine/Specs/Scene/PointCloudEyeDomeLightingSpec.js index ae47e5ee4d37..7668c5c4d02c 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 32b47597051e..134de14ba7a5 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 036b44416502..def2b35abfa9 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 85c4b026bb8b..f237f0a4aef3 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,28 +1422,20 @@ 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]); }); @@ -1482,28 +1474,20 @@ 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]); }); @@ -1521,7 +1505,7 @@ describe( x: 0.0, y: -1000000.0, z: 0.0, - }, + } ); } const p = polylines.add({ @@ -1611,7 +1595,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]); }); @@ -1773,19 +1757,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 + ) ); }); @@ -1809,49 +1793,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 ); } @@ -1902,10 +1886,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 ); }); @@ -1915,5 +1899,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 234a14376505..97fcc3ddb371 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 93200f8cd4cf..7ffae11984dc 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 501181fccadd..20f2260bb231 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,35 +552,39 @@ 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, + ]); }); }); }); @@ -590,7 +594,7 @@ describe( const stage = stages.add( new PostProcessStage({ fragmentShader: "void main() { out_FragColor = vec4(1.0); }", - }), + }) ); expect(stages.isDestroyed()).toEqual(false); stages.destroy(); @@ -598,5 +602,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 f5df1b810c52..442373b1e412 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 3350a5a2eb54..5031f55d01b0 100644 --- a/packages/engine/Specs/Scene/PostProcessStageLibrarySpec.js +++ b/packages/engine/Specs/Scene/PostProcessStageLibrarySpec.js @@ -40,8 +40,7 @@ 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(); }); @@ -66,7 +65,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createBlackAndWhiteStage(), + PostProcessStageLibrary.createBlackAndWhiteStage() ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -92,10 +91,10 @@ describe( { url: boxTexturedUrl, }, - scene, + scene ).then(function (model) { const stage = scene.postProcessStages.add( - PostProcessStageLibrary.createBlackAndWhiteStage(), + PostProcessStageLibrary.createBlackAndWhiteStage() ); stage.selected = []; @@ -146,7 +145,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createBrightnessStage(), + PostProcessStageLibrary.createBrightnessStage() ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -187,7 +186,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createNightVisionStage(), + PostProcessStageLibrary.createNightVisionStage() ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -227,7 +226,7 @@ describe( }); scene.postProcessStages.add( - PostProcessStageLibrary.createDepthViewStage(), + PostProcessStageLibrary.createDepthViewStage() ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -303,7 +302,7 @@ describe( const origin = Cartesian3.fromDegrees(-123.0744619, 44.0503706, 100.0); const modelMatrix = Transforms.headingPitchRollToFixedFrame( origin, - new HeadingPitchRoll(), + new HeadingPitchRoll() ); return loadAndZoomToModelAsync( @@ -313,7 +312,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 @@ -335,7 +334,7 @@ describe( // Render with depth of field and compare scene.postProcessStages.add( - PostProcessStageLibrary.createDepthOfFieldStage(), + PostProcessStageLibrary.createDepthOfFieldStage() ); scene.renderForSpecs(); expect(scene).toRenderAndCall(function (rgba) { @@ -424,7 +423,7 @@ describe( const origin = Cartesian3.fromDegrees(-123.0744619, 44.0503706, 100.0); const modelMatrix = Transforms.headingPitchRollToFixedFrame( origin, - new HeadingPitchRoll(), + new HeadingPitchRoll() ); return loadAndZoomToModelAsync( @@ -434,7 +433,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 @@ -496,5 +495,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 9d18a7d0e214..f88864496f65 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 2a3394e1274f..014af1452113 100644 --- a/packages/engine/Specs/Scene/PrimitiveCollectionSpec.js +++ b/packages/engine/Specs/Scene/PrimitiveCollectionSpec.js @@ -49,8 +49,9 @@ 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 @@ -694,5 +695,5 @@ describe( p2.destroy(); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/PrimitiveCullingSpec.js b/packages/engine/Specs/Scene/PrimitiveCullingSpec.js index de04c8934e0c..e9f311e4b55e 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,8 +158,9 @@ 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 @@ -336,5 +337,5 @@ describe( testOcclusionCull(primitive); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/PrimitivePipelineSpec.js b/packages/engine/Specs/Scene/PrimitivePipelineSpec.js index 16b4423b747c..63465acd4b42 100644 --- a/packages/engine/Specs/Scene/PrimitivePipelineSpec.js +++ b/packages/engine/Specs/Scene/PrimitivePipelineSpec.js @@ -17,23 +17,24 @@ 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, + transferableObjects + ); + const unpackedGeometry = PrimitivePipeline.unpackCreateGeometryResults( + results ); - const unpackedGeometry = - PrimitivePipeline.unpackCreateGeometryResults(results); expect(transferableObjects.length).toBe(1); expect(geometryToPack).toEqual(unpackedGeometry); @@ -58,14 +59,15 @@ describe( const transferableObjects = []; const results = PrimitivePipeline.packCreateGeometryResults( geometryToPack, - transferableObjects, + transferableObjects + ); + const unpackedGeometry = PrimitivePipeline.unpackCreateGeometryResults( + results ); - 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 010108e6905d..c218d4443153 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,8 +880,10 @@ 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 + ), }, }); @@ -895,30 +897,26 @@ 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]); }); @@ -939,8 +937,10 @@ 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,8 +1279,9 @@ describe( scene.render(); return primitive.ready; }).then(function () { - const attributes = - primitive.getGeometryInstanceAttributes("rectangle1"); + const attributes = primitive.getGeometryInstanceAttributes( + "rectangle1" + ); expect(function () { attributes.color = undefined; }).toThrowDeveloperError(); @@ -1325,7 +1326,7 @@ describe( scene.renderForSpecs(); expect( - primitive.getGeometryInstanceAttributes("unknown"), + primitive.getGeometryInstanceAttributes("unknown") ).not.toBeDefined(); }); @@ -1368,5 +1369,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 d397f452d9b6..997316c6d720 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 dbad6bc989a9..eeeb6d360612 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 0bdb4bc5bea5..3fd3c2aec10c 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 bbcbeca060da..ded2465c4efe 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 0e282f7be60c..1a2e3fc2d3b3 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,33 +530,32 @@ 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 - ) { - return Intersect.INTERSECTING; - } else if ( - boundingVolume === - notVisibleTile.data.tileBoundingRegion.boundingVolume - ) { - return Intersect.OUTSIDE; - } + if ( + boundingVolume === visibleTile.data.tileBoundingRegion.boundingVolume + ) { 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(); @@ -572,7 +571,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 @@ -867,7 +866,7 @@ describe("Scene/QuadtreePrimitive", function () { const removeFunc = quadtree.updateHeight( Cartographic.fromDegrees(-72.0, 40.0), - function (position) {}, + function (position) {} ); // determine what tiles to load @@ -940,12 +939,11 @@ 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); @@ -988,10 +986,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); @@ -1007,24 +1005,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 @@ -1040,36 +1038,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 @@ -1086,11 +1084,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); }); @@ -1150,27 +1148,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 @@ -1178,8 +1176,9 @@ 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 5a315ef2dc30..2e6d6c7edcb9 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 ef57c948ffa3..3195ee6c71e3 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 bf1540d4e976..aaded214a56a 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 a2f21c789697..5a6a69a34928 100644 --- a/packages/engine/Specs/Scene/SceneSpec.js +++ b/packages/engine/Specs/Scene/SceneSpec.js @@ -85,7 +85,7 @@ const propertyValueEpsilon = 0.01; */ function createEmbeddedGltfWithPropertyTexture( schema, - propertyTextureProperties, + propertyTextureProperties ) { const result = { extensions: { @@ -144,7 +144,8 @@ function createEmbeddedGltfWithPropertyTexture( }, buffers: [ { - uri: "data:application/gltf-buffer;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAA", + uri: + "data:application/gltf-buffer;base64,AAABAAIAAQADAAIAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAgD8AAAAAAACAPwAAgD8AAAAAAAAAAAAAAAAAAAAAAACAPwAAAAAAAAAA", byteLength: 156, }, ], @@ -167,7 +168,8 @@ function createEmbeddedGltfWithPropertyTexture( { // A 16x16 pixels image that contains all combinations of // (0, 127, 255) in its upper-left 9x9 pixels - uri: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAi0lEQVR42u2RUQ6AMAhDd3OO/qQt8VP8NRHjNpf0leI5ruqXbNVL4c9Dn+E8ljV+iLaXaoAY1YDaADaynBg2gFZLR1+wAdJEWZpW1AIVqmjCruqybw4qnEJbbQBHdWoS2XIUXdp+F8DNUOpM0tIZCusQJrzHNTnsOy2pFTZ7xpKhYFUu4M1v+OvrdQGABqEpS2kSLgAAAABJRU5ErkJggg==", + uri: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAi0lEQVR42u2RUQ6AMAhDd3OO/qQt8VP8NRHjNpf0leI5ruqXbNVL4c9Dn+E8ljV+iLaXaoAY1YDaADaynBg2gFZLR1+wAdJEWZpW1AIVqmjCruqybw4qnEJbbQBHdWoS2XIUXdp+F8DNUOpM0tIZCusQJrzHNTnsOy2pFTZ7xpKhYFUu4M1v+OvrdQGABqEpS2kSLgAAAABJRU5ErkJggg==", mimeType: "image/png", }, ], @@ -309,7 +311,8 @@ function createPropertyTextureGltfScalarArray() { name: "Example class", properties: { example_fixed_length_UINT8_SCALAR_array: { - name: "Example fixed-length SCALAR array property with UINT8 components", + name: + "Example fixed-length SCALAR array property with UINT8 components", type: "SCALAR", componentType: "UINT8", array: true, @@ -477,7 +480,7 @@ async function loadAsModel(scene, gltf) { scene.renderForSpecs(); return model.ready; }, - { timeout: 10000 }, + { timeout: 10000 } ); } @@ -521,7 +524,7 @@ function pickMetadataAt(scene, schemaId, className, propertyName, x, y) { screenPosition, schemaId, className, - propertyName, + propertyName ); return metadataValue; } @@ -563,7 +566,7 @@ describe( data, headers, deferred, - overrideMimeType, + overrideMimeType ) { Resource._DefaultImplementations.loadWithXhr( path, @@ -571,14 +574,14 @@ describe( method, data, headers, - deferred, + deferred ); }; } function returnQuantizedMeshTileJson() { return returnTileJson( - "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json", + "Data/CesiumTerrainTileJson/QuantizedMesh.tile.json" ); } @@ -608,7 +611,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); @@ -660,14 +663,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(); @@ -767,7 +770,7 @@ describe( const center = Cartesian3.add( scene.camera.position, scene.camera.direction, - new Cartesian3(), + new Cartesian3() ); const c = new DrawCommand({ @@ -801,15 +804,16 @@ 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)); @@ -836,7 +840,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const rectanglePrimitive2 = createRectangle(rectangle, 1000.0); @@ -844,7 +848,7 @@ describe( 0.0, 1.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -874,7 +878,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const rectanglePrimitive2 = createRectangle(rectangle); @@ -882,7 +886,7 @@ describe( 0.0, 1.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -912,7 +916,7 @@ describe( 1.0, 0.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -975,7 +979,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1036,7 +1040,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 () { @@ -1054,7 +1058,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 () { @@ -1072,7 +1076,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 () { @@ -1090,7 +1094,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 () { @@ -1108,7 +1112,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); @@ -1125,7 +1129,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 () { @@ -1143,7 +1147,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 () { @@ -1169,7 +1173,7 @@ describe( 1.0, 0.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -1198,7 +1202,7 @@ describe( 1.0, 0.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -1223,7 +1227,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1233,7 +1237,7 @@ describe( destination: new Cartesian3( Ellipsoid.WGS84.maximumRadius * Math.PI + 10000.0, 0.0, - 10.0, + 10.0 ), convert: false, }); @@ -1258,7 +1262,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = s.primitives; @@ -1268,7 +1272,7 @@ describe( destination: new Cartesian3( Ellipsoid.WGS84.maximumRadius * Math.PI, 0.0, - 10.0, + 10.0 ), convert: false, }); @@ -1296,7 +1300,7 @@ describe( 4.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1323,7 +1327,7 @@ describe( 1.0, 0.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -1349,7 +1353,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2, + canvas.clientHeight / 2 ); expect(scene).toRenderAndCall(function () { @@ -1361,7 +1365,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1389,7 +1393,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2, + canvas.clientHeight / 2 ); expect(scene).toRenderAndCall(function () { @@ -1401,7 +1405,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1429,7 +1433,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2, + canvas.clientHeight / 2 ); expect(scene).toRenderAndCall(function () { @@ -1441,7 +1445,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1469,7 +1473,7 @@ describe( const canvas = scene.canvas; const windowPosition = new Cartesian2( canvas.clientWidth / 2, - canvas.clientHeight / 2, + canvas.clientHeight / 2 ); const rectanglePrimitive = createRectangle(rectangle); @@ -1477,7 +1481,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1509,17 +1513,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; @@ -1547,22 +1551,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); @@ -1570,7 +1574,7 @@ describe( 1.0, 0.0, 0.0, - 1.0, + 1.0 ); const primitives = scene.primitives; @@ -1580,12 +1584,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); }); }); @@ -1743,7 +1747,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(); @@ -1767,7 +1771,7 @@ describe( scene.render(); scene.camera.twistLeft( - CesiumMath.PI * (scene.camera.percentageChanged + 0.1), + CesiumMath.PI * (scene.camera.percentageChanged + 0.1) ); scene.initializeFrame(); @@ -1788,7 +1792,7 @@ describe( scene.render(); scene.camera.twistLeft( - CesiumMath.PI * (scene.camera.percentageChanged + 0.1), + CesiumMath.PI * (scene.camera.percentageChanged + 0.1) ); scene.initializeFrame(); @@ -1810,7 +1814,7 @@ describe( scene.camera.moveUp( scene.camera.positionCartographic.height * - (scene.camera.percentageChanged + 0.1), + (scene.camera.percentageChanged + 0.1) ); scene.initializeFrame(); @@ -1835,7 +1839,7 @@ describe( scene.camera.moveLeft( scene.camera.positionCartographic.height * - (scene.camera.percentageChanged + 0.1), + (scene.camera.percentageChanged + 0.1) ); scene.initializeFrame(); @@ -1870,7 +1874,7 @@ describe( 1.0, 0.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -1896,7 +1900,7 @@ describe( 1.0, 0.0, 0.0, - 0.5, + 0.5 ); const primitives = scene.primitives; @@ -1923,7 +1927,7 @@ describe( expect(SceneTransforms.worldToWindowCoordinates).toHaveBeenCalledWith( scene, mockPosition, - undefined, + undefined ); }); @@ -1936,7 +1940,7 @@ describe( expect(SceneTransforms.worldToWindowCoordinates).toHaveBeenCalledWith( scene, mockPosition, - result, + result ); }); @@ -1960,13 +1964,15 @@ 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(); @@ -2241,7 +2247,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); @@ -2256,7 +2262,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); @@ -2271,7 +2277,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); @@ -2289,7 +2295,7 @@ describe( const lastFrameNumber = scene.frameState.frameNumber; const lastRenderTime = JulianDate.clone( scene.lastRenderTime, - scratchTime, + scratchTime ); expect(lastRenderTime).toBeDefined(); expect(scene._renderRequested).toBe(false); @@ -2302,12 +2308,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); }); @@ -2318,7 +2324,7 @@ describe( const lastFrameNumber = scene.frameState.frameNumber; const lastRenderTime = JulianDate.clone( scene.lastRenderTime, - scratchTime, + scratchTime ); expect(lastRenderTime).toBeDefined(); expect(scene._renderRequested).toBe(false); @@ -2329,7 +2335,7 @@ describe( const farFuture = JulianDate.addDays( lastRenderTime, 10000, - new JulianDate(), + new JulianDate() ); scene.renderForSpecs(); @@ -2377,12 +2383,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(); @@ -2392,12 +2398,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(); @@ -2423,12 +2429,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(); @@ -2499,12 +2505,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); @@ -2539,12 +2545,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); @@ -2563,7 +2569,7 @@ describe( 2.3929070618374535, -0.07149851443375346, -25000.0, - globe.ellipsoid, + globe.ellipsoid ); const radius = 10.0; @@ -2586,12 +2592,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); @@ -2608,7 +2614,7 @@ describe( 2.3929070618374535, -0.07149851443375346, -25000.0, - globe.ellipsoid, + globe.ellipsoid ); const radius = 10.0; @@ -2643,18 +2649,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; @@ -2674,12 +2680,12 @@ describe( destination: new Cartesian3( 2764681.3022502237, -20999839.371941473, - 14894754.464869803, + 14894754.464869803 ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5687983447998315, - 0, + 0 ), }); @@ -2708,12 +2714,12 @@ describe( destination: new Cartesian3( -557278.4840232887, -6744284.200717078, - 2794079.461722868, + 2794079.461722868 ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5687983448015541, - 0, + 0 ), }); @@ -2724,7 +2730,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) ), }, }); @@ -2736,7 +2742,7 @@ describe( closed: true, }), asynchronous: false, - }), + }) ); await updateGlobeUntilDone(scene); @@ -2756,12 +2762,12 @@ describe( destination: new Cartesian3( -557278.4840232887, -6744284.200717078, - 2794079.461722868, + 2794079.461722868 ), orientation: new HeadingPitchRoll( 6.283185307179586, -1.5687983448015541, - 0, + 0 ), }); @@ -2772,7 +2778,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) ), }, }); @@ -2784,7 +2790,7 @@ describe( closed: true, }), asynchronous: false, - }), + }) ); await updateGlobeUntilDone(scene); @@ -2846,7 +2852,7 @@ describe( const webglStub = !!window.webglStub; const defaultDate = JulianDate.fromDate( - new Date("January 1, 2014 12:00:00 UTC"), + new Date("January 1, 2014 12:00:00 UTC") ); it("throws without windowPosition", async function () { @@ -2938,13 +2944,13 @@ describe( const windowPosition = new Cartesian2( Math.floor(canvasSizeX / 2), - Math.floor(canvasSizeY / 2), + Math.floor(canvasSizeY / 2) ); const actualMetadataValue = scene.pickMetadata( windowPosition, schemaId, className, - propertyName, + propertyName ); expect(actualMetadataValue).toBeUndefined(); scene.destroyForSpecs(); @@ -2968,13 +2974,13 @@ describe( const windowPosition = new Cartesian2( Math.floor(canvasSizeX / 2), - Math.floor(canvasSizeY / 2), + Math.floor(canvasSizeY / 2) ); const actualMetadataValue = scene.pickMetadata( windowPosition, schemaId, className, - propertyName, + propertyName ); expect(actualMetadataValue).toBeUndefined(); scene.destroyForSpecs(); @@ -2994,7 +3000,7 @@ describe( const windowPosition = new Cartesian2( Math.floor(canvasSizeX / 2), - Math.floor(canvasSizeY / 2), + Math.floor(canvasSizeY / 2) ); const metadataSchema = scene.pickMetadataSchema(windowPosition); @@ -3026,7 +3032,7 @@ describe( const windowPosition = new Cartesian2( Math.floor(canvasSizeX / 2), - Math.floor(canvasSizeY / 2), + Math.floor(canvasSizeY / 2) ); // The pickMetadataSchema call should return the schema that @@ -3070,7 +3076,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3078,7 +3084,7 @@ describe( className, propertyName, 0, - 1, + 1 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3086,7 +3092,7 @@ describe( className, propertyName, 0, - 2, + 2 ); const expectedMetadataValue0 = 0; const expectedMetadataValue1 = 127; @@ -3094,15 +3100,15 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); @@ -3137,7 +3143,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3145,7 +3151,7 @@ describe( className, propertyName, 3, - 0, + 0 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3153,7 +3159,7 @@ describe( className, propertyName, 6, - 0, + 0 ); const expectedMetadataValue0 = 0.0; const expectedMetadataValue1 = 0.5; @@ -3161,15 +3167,15 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); @@ -3204,7 +3210,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3212,7 +3218,7 @@ describe( className, propertyName, 1, - 1, + 1 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3220,7 +3226,7 @@ describe( className, propertyName, 2, - 2, + 2 ); const expectedMetadataValue0 = [0, 0, 0]; const expectedMetadataValue1 = [127, 0, 127]; @@ -3228,15 +3234,15 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); @@ -3272,7 +3278,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3280,7 +3286,7 @@ describe( className, propertyName, 1, - 1, + 1 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3288,7 +3294,7 @@ describe( className, propertyName, 2, - 2, + 2 ); const expectedMetadataValue0 = new Cartesian2(0, 0); const expectedMetadataValue1 = new Cartesian2(127, 0); @@ -3296,15 +3302,15 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); @@ -3340,7 +3346,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3348,7 +3354,7 @@ describe( className, propertyName, 1, - 1, + 1 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3356,7 +3362,7 @@ describe( className, propertyName, 2, - 2, + 2 ); const expectedMetadataValue0 = new Cartesian2(0.0, 0.0); @@ -3365,15 +3371,15 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); @@ -3409,7 +3415,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3417,7 +3423,7 @@ describe( className, propertyName, 1, - 1, + 1 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3425,7 +3431,7 @@ describe( className, propertyName, 2, - 2, + 2 ); const expectedMetadataValue0 = new Cartesian3(0, 0, 0); const expectedMetadataValue1 = new Cartesian3(127, 0, 127); @@ -3433,15 +3439,15 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); @@ -3477,7 +3483,7 @@ describe( className, propertyName, 0, - 0, + 0 ); const actualMetadataValue1 = pickMetadataAt( scene, @@ -3485,7 +3491,7 @@ describe( className, propertyName, 1, - 1, + 1 ); const actualMetadataValue2 = pickMetadataAt( scene, @@ -3493,7 +3499,7 @@ describe( className, propertyName, 2, - 2, + 2 ); const expectedMetadataValue0 = new Cartesian4(0, 0, 0, 0); @@ -3502,18 +3508,18 @@ describe( expect(actualMetadataValue0).toEqualEpsilon( expectedMetadataValue0, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue1).toEqualEpsilon( expectedMetadataValue1, - propertyValueEpsilon, + propertyValueEpsilon ); expect(actualMetadataValue2).toEqualEpsilon( expectedMetadataValue2, - propertyValueEpsilon, + propertyValueEpsilon ); scene.destroyForSpecs(); }); }), - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/SceneTransformsSpec.js b/packages/engine/Specs/Scene/SceneTransformsSpec.js index a9a09c190ec5..180a57ed4451 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,22 +80,24 @@ 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); @@ -105,7 +107,7 @@ describe( const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position, + position ); expect(windowCoordinates).not.toBeDefined(); }); @@ -113,7 +115,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); @@ -121,8 +123,10 @@ describe( // Update scene state scene.renderForSpecs(); - const drawingBufferCoordinates = - SceneTransforms.worldToDrawingBufferCoordinates(scene, position); + const drawingBufferCoordinates = SceneTransforms.worldToDrawingBufferCoordinates( + scene, + position + ); expect(drawingBufferCoordinates).not.toBeDefined(); }); @@ -136,11 +140,11 @@ describe( const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position, + position ); expect(windowCoordinates).toEqualEpsilon( actualWindowCoordinates, - CesiumMath.EPSILON2, + CesiumMath.EPSILON2 ); }); @@ -151,14 +155,16 @@ 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 ); }); @@ -173,12 +179,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(); }); @@ -194,11 +200,13 @@ 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(); }); @@ -208,7 +216,7 @@ describe( -0.000001, -0.000001, 0.000001, - 0.000001, + 0.000001 ), }); @@ -219,7 +227,7 @@ describe( const position = Cartesian3.fromDegrees(0, 0); const windowCoordinates = SceneTransforms.worldToWindowCoordinates( scene, - position, + position ); expect(windowCoordinates.x).toBeGreaterThan(0.0); @@ -243,14 +251,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); @@ -266,7 +274,7 @@ describe( -0.000001, -0.000001, 0.000001, - 0.000001, + 0.000001 ), }); @@ -275,8 +283,10 @@ 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); @@ -298,11 +308,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 593ca54b10f9..d5367349c33a 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,16 +1316,15 @@ 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); }); @@ -1339,7 +1338,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); @@ -1356,7 +1355,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); @@ -1379,17 +1378,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); }); @@ -1410,17 +1409,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); }); @@ -1433,11 +1432,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); @@ -1445,7 +1444,7 @@ describe("Scene/ScreenSpaceCameraController", function () { const vector = Cartesian3.subtract( camera.position, position, - new Cartesian3(), + new Cartesian3() ); const normalizedVector = Cartesian3.normalize(vector, vector); @@ -1458,11 +1457,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); @@ -1471,15 +1470,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); @@ -1492,11 +1491,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); @@ -1505,15 +1504,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); }); @@ -1521,29 +1520,28 @@ 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); }); @@ -1555,11 +1553,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); @@ -1573,11 +1571,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); @@ -1586,17 +1584,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); }); @@ -1605,17 +1603,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); @@ -1623,11 +1621,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); @@ -1636,20 +1634,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 ); }); @@ -1658,17 +1656,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); @@ -1676,30 +1674,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 ); }); @@ -1738,11 +1736,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); @@ -1760,18 +1758,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); @@ -1782,7 +1780,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); @@ -1796,14 +1794,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) ); }); @@ -1820,11 +1818,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); @@ -1832,7 +1830,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.positionCartographic.height).toEqualEpsilon( controller.minimumZoomDistance, - CesiumMath.EPSILON5, + CesiumMath.EPSILON5 ); }); @@ -1849,11 +1847,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); @@ -1861,7 +1859,7 @@ describe("Scene/ScreenSpaceCameraController", function () { expect(camera.position.z).toEqualEpsilon( controller.minimumZoomDistance, - CesiumMath.EPSILON7, + CesiumMath.EPSILON7 ); }); @@ -1879,18 +1877,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 ); }); @@ -1908,11 +1906,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); @@ -1929,24 +1927,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 ); }); @@ -1958,17 +1956,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); @@ -1976,7 +1974,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 00d862e26af7..762791743a0d 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 060940e59475..8eba7af6b61f 100644 --- a/packages/engine/Specs/Scene/ShadowVolumeAppearanceSpec.js +++ b/packages/engine/Specs/Scene/ShadowVolumeAppearanceSpec.js @@ -31,26 +31,24 @@ 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({ @@ -83,13 +81,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(); @@ -99,13 +97,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 () { @@ -118,24 +116,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); @@ -169,46 +167,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); }); @@ -236,19 +234,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 @@ -264,32 +262,31 @@ 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; @@ -318,35 +315,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); }); @@ -355,13 +352,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); @@ -373,7 +370,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection, + projection ); defines = shaderSource.defines; expect(defines.length).toEqual(6); @@ -389,13 +386,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); @@ -406,7 +403,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection, + projection ); defines = shaderSource.defines; expect(defines.length).toEqual(5); @@ -422,13 +419,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); @@ -438,7 +435,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection, + projection ); defines = shaderSource.defines; expect(defines.indexOf("TEXTURE_COORDINATES")).not.toEqual(-1); @@ -457,13 +454,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); @@ -475,7 +472,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection, + projection ); defines = shaderSource.defines; expect(defines.length).toEqual(6); @@ -491,13 +488,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); @@ -507,7 +504,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection, + projection ); defines = shaderSource.defines; @@ -522,13 +519,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); @@ -537,7 +534,7 @@ describe("Scene/ShadowVolumeAppearance", function () { [], testVs, true, - projection, + projection ); defines = shaderSource.defines; @@ -554,7 +551,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const sphericalTexturedAppearance = new ShadowVolumeAppearance( true, false, - textureMaterialAppearance, + textureMaterialAppearance ); let shaderSource = sphericalTexturedAppearance.createFragmentShader(false); let defines = shaderSource.defines; @@ -591,7 +588,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const planarColorAppearance = new ShadowVolumeAppearance( true, true, - perInstanceColorMaterialAppearance, + perInstanceColorMaterialAppearance ); shaderSource = planarColorAppearance.createFragmentShader(false); defines = shaderSource.defines; @@ -619,7 +616,7 @@ describe("Scene/ShadowVolumeAppearance", function () { const flatSphericalTexturedAppearance = new ShadowVolumeAppearance( true, false, - flatTextureMaterialAppearance, + flatTextureMaterialAppearance ); shaderSource = flatSphericalTexturedAppearance.createFragmentShader(false); defines = shaderSource.defines; @@ -638,7 +635,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 f1cc95c6848f..41205f38c341 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,17 +121,19 @@ 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); @@ -144,17 +146,19 @@ 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, @@ -171,7 +175,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(); @@ -180,7 +184,7 @@ describe("Scene/SingleTileImageryProvider", function () { "Data/Images/Red16x16.png", { credit: "Thanks to our awesome made up source of this imagery!", - }, + } ); expect(providerWithCredit.credit).toBeDefined(); @@ -207,14 +211,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 6f0622a80d15..71a215cff6cb 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 4db7c8702d18..435fff1d6b17 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 e264444a9fd0..500386e89389 100644 --- a/packages/engine/Specs/Scene/SpecularEnvironmentCubeMapSpec.js +++ b/packages/engine/Specs/Scene/SpecularEnvironmentCubeMapSpec.js @@ -178,14 +178,11 @@ 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); + }); } } } @@ -235,9 +232,9 @@ describe( cubeMap.update(frameState); return defined(error); }, - { timeout: 10000 }, + { timeout: 10000 } ); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/SphereEmitterSpec.js b/packages/engine/Specs/Scene/SphereEmitterSpec.js index 122605274517..7b050fecc814 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 d1853327fa84..1b396273f39b 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 9637568d61e4..caa9fd397934 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 9726006d3c12..cf3589dd19af 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,10 +115,18 @@ 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); @@ -129,10 +137,18 @@ 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); @@ -143,10 +159,18 @@ 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); @@ -157,10 +181,18 @@ 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); @@ -171,10 +203,18 @@ 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); @@ -185,10 +225,18 @@ 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); @@ -199,10 +247,18 @@ 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); @@ -213,10 +269,18 @@ 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); }); @@ -351,24 +415,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); }); }); @@ -492,7 +556,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 = [ @@ -538,22 +602,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. @@ -564,10 +628,18 @@ 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); @@ -603,7 +675,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) ); }); }); @@ -833,13 +905,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); @@ -849,7 +921,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); @@ -860,7 +932,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); @@ -871,7 +943,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); @@ -880,7 +952,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 ); }); }); @@ -903,7 +975,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([1.0, 1.0, 1.5, 1.5]), }), - westN, + westN ) .createMeshWillSucceed(westN); @@ -915,7 +987,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([1.5, 1.5, 2.0, 2.0]), }), - westS, + westS ) .createMeshWillSucceed(westS); @@ -927,7 +999,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([3.0, 3.0, 3.5, 3.5]), }), - eastN, + eastN ) .createMeshWillSucceed(eastN); @@ -939,7 +1011,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([3.5, 3.5, 4.0, 4.0]), }), - eastS, + eastS ) .createMeshWillSucceed(eastS); @@ -951,7 +1023,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([5.0, 5.5, 5.0, 5.5]), }), - northW, + northW ) .createMeshWillSucceed(northW); @@ -963,7 +1035,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([5.5, 6.0, 6.5, 6.0]), }), - northE, + northE ) .createMeshWillSucceed(northE); @@ -975,7 +1047,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([7.0, 7.5, 7.0, 7.5]), }), - southW, + southW ) .createMeshWillSucceed(southW); @@ -987,7 +1059,7 @@ describe("Scene/TerrainFillMesh", function () { createdByUpsampling: false, buffer: new Float32Array([7.5, 8.0, 7.5, 8.0]), }), - southE, + southE ) .createMeshWillSucceed(southE); @@ -1059,10 +1131,18 @@ 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); @@ -1070,7 +1150,7 @@ describe("Scene/TerrainFillMesh", function () { .process([westernHemisphere, easternHemisphere]) .then(function () { const fill = (easternHemisphere.data.fill = new TerrainFillMesh( - easternHemisphere, + easternHemisphere )); fill.eastTiles.push(westernHemisphere); @@ -1093,10 +1173,18 @@ 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); @@ -1105,7 +1193,7 @@ describe("Scene/TerrainFillMesh", function () { .process([westernHemisphere, easternHemisphere]) .then(function () { const fill = (westernHemisphere.data.fill = new TerrainFillMesh( - westernHemisphere, + westernHemisphere )); fill.westTiles.push(easternHemisphere); @@ -1138,13 +1226,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 && @@ -1157,7 +1245,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 4d67dc7f3fd0..5b93cc1eca42 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 99f0a8e6c101..92beba6e486f 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 54f955f3fef8..61f0d8f20f1b 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 02cf2668b452..32c87cb0078f 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 60e793aa9990..b4af4378078b 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 0e766f18b399..72494dceb68c 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,18 +180,20 @@ 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(); @@ -201,21 +203,23 @@ 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(); @@ -226,21 +230,23 @@ 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(); @@ -250,7 +256,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 @@ -261,16 +267,18 @@ 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(); @@ -280,7 +288,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(); }); @@ -291,30 +299,28 @@ 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" ); }); @@ -326,7 +332,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { rectangle: rectangle, - }, + } ); // check some values coming from tilemapresource.xml @@ -337,34 +343,36 @@ 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(); @@ -377,7 +385,7 @@ describe("Scene/TileMapServiceImageryProvider", function () { "made/up/tms/server", { maximumLevel: 5, - }, + } ); expect(provider.maximumLevel).toEqual(5); @@ -385,8 +393,9 @@ 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); @@ -405,14 +414,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 @@ -450,36 +459,37 @@ 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 ); }); @@ -499,8 +509,9 @@ 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); @@ -522,8 +533,9 @@ 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); @@ -545,8 +557,9 @@ 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); @@ -568,27 +581,28 @@ 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); }); @@ -609,12 +623,13 @@ 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); @@ -622,12 +637,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); }); @@ -652,12 +667,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); @@ -665,12 +680,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); }); @@ -695,12 +710,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); @@ -708,12 +723,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); }); @@ -724,7 +739,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. @@ -746,9 +761,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 249e7de0419c..ccfd5cfae0cb 100644 --- a/packages/engine/Specs/Scene/TileMetadataSpec.js +++ b/packages/engine/Specs/Scene/TileMetadataSpec.js @@ -144,25 +144,31 @@ 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 463cb2548489..91ad1dbfc720 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 4f3ac5e47abe..f161f7dbe494 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 ad164a4c3937..6fdfdd92cb55 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 96697a41448e..08e08d9a34ef 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 d43be3ed576e..e7861ac54faa 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,34 +52,94 @@ 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, ]), ]; @@ -261,7 +321,7 @@ describe( const boundingSphereFrame1 = pointCloud.boundingSphere; expect(boundingSphereFrame1).toBeDefined(); expect( - BoundingSphere.equals(boundingSphereFrame0, boundingSphereFrame1), + BoundingSphere.equals(boundingSphereFrame0, boundingSphereFrame1) ).toBe(false); }); }); @@ -316,7 +376,7 @@ describe( const frames = pointCloud._frames; const framesLength = frames.length; expect(pointCloud.totalMemoryUsageInBytes).toBe( - singleFrameMemoryUsage * framesLength, + singleFrameMemoryUsage * framesLength ); pointCloud.maximumMemoryUsage = 0; @@ -338,7 +398,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); @@ -433,7 +493,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, @@ -540,7 +600,7 @@ describe( clock.currentTime = JulianDate.addSeconds( dates[0], -10.0, - new JulianDate(), + new JulianDate() ); scene.renderForSpecs(); expect(scene.frameState.commandList.length).toBe(0); @@ -552,7 +612,7 @@ describe( clock.currentTime = JulianDate.addSeconds( dates[5], 10.0, - new JulianDate(), + new JulianDate() ); scene.renderForSpecs(); expect(scene.frameState.commandList.length).toBe(0); @@ -713,25 +773,23 @@ 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); @@ -797,7 +855,7 @@ describe( clock.currentTime = JulianDate.addSeconds( dates[0], -10.0, - new JulianDate(), + new JulianDate() ); scene.renderForSpecs(); expect(spyFrameChanged.calls.count()).toBe(6); @@ -820,5 +878,5 @@ describe( }); }); }, - "WebGL", + "WebGL" ); diff --git a/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js b/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js index 410234e577c4..36ea7dcf2459 100644 --- a/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js +++ b/packages/engine/Specs/Scene/TranslucentTileClassificationSpec.js @@ -82,8 +82,7 @@ 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); } }; @@ -119,7 +118,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) ), }, }), @@ -150,7 +149,7 @@ describe( groundPolylinePrimitive = new SpecPrimitive( primitive, - Pass.CESIUM_3D_TILE_CLASSIFICATION, + Pass.CESIUM_3D_TILE_CLASSIFICATION ); scene.groundPrimitives.add(groundPolylinePrimitive); }); @@ -188,37 +187,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 ); } @@ -234,7 +233,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - undefined, + undefined ); expectResources(translucentTileClassification, false); @@ -244,7 +243,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 @@ -259,7 +258,7 @@ describe( executeCommand, passState, [], - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); expectResources(translucentTileClassification, false); @@ -269,7 +268,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); expectResources(translucentTileClassification, true); @@ -289,7 +288,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 @@ -303,7 +302,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); expect(translucentTileClassification.hasTranslucentDepth).toBe(true); @@ -316,7 +315,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 @@ -328,7 +327,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const drawClassificationFBO = @@ -347,7 +346,7 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const postClassifyPixels = readPixels(drawClassificationFBO); @@ -358,7 +357,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 @@ -370,7 +369,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const accumulationFBO = @@ -390,7 +389,7 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); expect(readPixels(accumulationFBO)).toEqual([0, 0, 0, 0]); @@ -400,13 +399,13 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); translucentTileClassification.executeClassificationCommands( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const secondFrustumAccumulation = accumulationFBO; @@ -428,7 +427,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 @@ -443,7 +442,7 @@ describe( executeCommand, passState, [], - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const preClassifyPixels = readPixels(drawClassificationFBO); @@ -460,7 +459,7 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const postClassifyPixels = readPixels(drawClassificationFBO); @@ -471,7 +470,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 @@ -497,7 +496,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const frustumCommands = { @@ -512,12 +511,12 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const preCompositePixels = readPixels(targetColorFBO); const pixelsToComposite = readPixels( - translucentTileClassification._drawClassificationFBO.framebuffer, + translucentTileClassification._drawClassificationFBO.framebuffer ); const framebuffer = passState.framebuffer; @@ -544,7 +543,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 @@ -578,7 +577,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const frustumCommands = { @@ -595,7 +594,7 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); // Second Frustum @@ -604,14 +603,14 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); translucentTileClassification.executeClassificationCommands( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const framebuffer = passState.framebuffer; @@ -637,7 +636,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 @@ -663,7 +662,7 @@ describe( executeCommand, passState, [], - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const frustumCommands = { @@ -678,7 +677,7 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const preCompositePixels = readPixels(targetColorFBO); @@ -697,7 +696,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 @@ -709,7 +708,7 @@ describe( executeCommand, passState, translucentPrimitive.commands, - globeDepthFramebuffer.depthStencilTexture, + globeDepthFramebuffer.depthStencilTexture ); const drawClassificationFBO = @@ -728,7 +727,7 @@ describe( scene, executeCommand, passState, - frustumCommands, + frustumCommands ); const postClassifyPixels = readPixels(drawClassificationFBO); @@ -745,7 +744,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 @@ -756,10 +755,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 57850a44648d..db639dbcec62 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 1e52aa3b70ef..a7e6e2a3761b 100644 --- a/packages/engine/Specs/Scene/UrlTemplateImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/UrlTemplateImageryProviderSpec.js @@ -60,16 +60,18 @@ 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(); @@ -107,18 +109,20 @@ 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(); @@ -159,14 +163,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 @@ -192,23 +196,26 @@ 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(); @@ -218,7 +225,8 @@ 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", @@ -228,20 +236,22 @@ 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(); @@ -251,7 +261,8 @@ 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", @@ -261,20 +272,22 @@ 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(); @@ -284,7 +297,8 @@ 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", @@ -294,20 +308,22 @@ 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(); @@ -321,18 +337,20 @@ 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(); @@ -346,18 +364,20 @@ 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(); @@ -371,18 +391,20 @@ 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(); @@ -396,18 +418,20 @@ 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(); @@ -421,21 +445,23 @@ 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(); @@ -448,21 +474,23 @@ 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(); @@ -475,21 +503,23 @@ 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(); @@ -502,21 +532,23 @@ 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(); @@ -526,31 +558,32 @@ describe("Scene/UrlTemplateImageryProvider", function () { it("evaluates multiple coordinate patterns", function () { const provider = new UrlTemplateImageryProvider({ - 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}`, - ); + url: + "{westDegrees} {westProjected} {southProjected} {southDegrees} {eastProjected} {eastDegrees} {northDegrees} {northProjected}", + }); - // 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).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 + ); + }); return provider.requestImage(1, 1, 2).then(function (image) { expect(Resource._Implementations.createImage).toHaveBeenCalled(); @@ -563,18 +596,20 @@ 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(); @@ -588,18 +623,20 @@ 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(); @@ -613,18 +650,20 @@ 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(); @@ -647,18 +686,20 @@ 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 c5e071e372d2..0e6ca02f10d1 100644 --- a/packages/engine/Specs/Scene/Vector3DTileClampedPolylinesSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTileClampedPolylinesSpec.js @@ -65,8 +65,9 @@ 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({ @@ -97,7 +98,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, @@ -114,7 +115,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, @@ -137,5 +138,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 22581023dd11..4106b41aa0ed 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,29 +198,30 @@ 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); }); @@ -229,13 +230,14 @@ 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(); @@ -243,7 +245,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(); @@ -251,7 +253,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(); @@ -259,7 +261,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(); @@ -271,11 +273,12 @@ 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. @@ -284,22 +287,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); @@ -308,22 +311,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); }); @@ -332,11 +335,12 @@ 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({ @@ -349,22 +353,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); @@ -373,22 +377,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); }); @@ -398,29 +402,30 @@ 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); }); @@ -429,14 +434,15 @@ 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(); @@ -445,7 +451,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(); @@ -454,7 +460,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(); @@ -463,7 +469,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(); @@ -476,29 +482,30 @@ 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); }); @@ -507,14 +514,15 @@ 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(); @@ -523,7 +531,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(); @@ -532,7 +540,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(); @@ -541,7 +549,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(); @@ -554,29 +562,30 @@ 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); }); @@ -585,29 +594,30 @@ 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); }); @@ -627,29 +637,30 @@ 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); }); @@ -658,13 +669,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(); @@ -676,11 +687,12 @@ 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. @@ -689,22 +701,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]); @@ -715,22 +727,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); @@ -739,22 +751,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); }); @@ -763,11 +775,12 @@ 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. @@ -776,22 +789,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); @@ -800,22 +813,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); }); @@ -828,13 +841,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; @@ -854,13 +867,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; @@ -880,13 +893,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; @@ -902,29 +915,30 @@ 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); }); @@ -933,14 +947,15 @@ 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(); @@ -949,7 +964,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(); @@ -958,7 +973,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(); @@ -967,7 +982,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(); @@ -980,29 +995,30 @@ 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); }); @@ -1011,14 +1027,15 @@ 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(); @@ -1027,7 +1044,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(); @@ -1036,7 +1053,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(); @@ -1045,7 +1062,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(); @@ -1058,29 +1075,30 @@ 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); }); @@ -1089,29 +1107,30 @@ 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); }); @@ -1133,22 +1152,23 @@ 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)); @@ -1192,14 +1212,15 @@ 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(); @@ -1207,7 +1228,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(); @@ -1215,7 +1236,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(); @@ -1223,7 +1244,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(); @@ -1235,22 +1256,23 @@ 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. @@ -1358,22 +1380,23 @@ 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. @@ -1443,13 +1466,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; @@ -1469,13 +1492,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; @@ -1495,13 +1518,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; @@ -1517,23 +1540,24 @@ 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)); @@ -1577,14 +1601,15 @@ 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(); @@ -1593,7 +1618,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(); @@ -1602,7 +1627,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(); @@ -1611,7 +1636,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(); @@ -1624,23 +1649,24 @@ 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)); @@ -1684,14 +1710,15 @@ 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(); @@ -1700,7 +1727,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(); @@ -1709,7 +1736,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(); @@ -1718,7 +1745,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(); @@ -1731,14 +1758,15 @@ 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. @@ -1749,7 +1777,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. @@ -1760,7 +1788,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. @@ -1771,7 +1799,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. @@ -1786,14 +1814,15 @@ 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. @@ -1804,7 +1833,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. @@ -1815,7 +1844,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. @@ -1826,7 +1855,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. @@ -1845,22 +1874,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 ); }); }); @@ -1871,7 +1900,7 @@ describe( vectorTilePolylinesBatchedChildrenTileset, { vectorKeepDecodedPositions: true, - }, + } ).then(function (tileset) { const content = tileset.root.children[0].content; expect(content.getPolylinePositions(0).length).toBe(60); @@ -1888,22 +1917,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 ); }); }); @@ -1914,7 +1943,7 @@ describe( vectorTilePolylinesWithBatchIdsTileset, { vectorKeepDecodedPositions: true, - }, + } ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(1); @@ -1928,7 +1957,7 @@ describe( vectorTilePolygonsWithBatchTableTileset, { vectorKeepDecodedPositions: true, - }, + } ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(0); @@ -1942,7 +1971,7 @@ describe( vectorTilePolylinesWithBatchIdsTileset, { vectorKeepDecodedPositions: false, - }, + } ).then(function (tileset) { const content = tileset.root.content; const polylinePositions = content.getPolylinePositions(0); @@ -1962,7 +1991,7 @@ describe( -0.02, -0.01, 0.02, - 0.01, + 0.01 ); const width = combinedTilesetRectangle.width; const step = width / 3; @@ -1975,30 +2004,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. @@ -2009,7 +2038,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); }); @@ -2018,11 +2047,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(); @@ -2030,9 +2059,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(); @@ -2040,7 +2069,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(); @@ -2052,19 +2081,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. @@ -2075,7 +2104,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); }); @@ -2084,11 +2113,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(); @@ -2097,9 +2126,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(); @@ -2108,7 +2137,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(); @@ -2122,7 +2151,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 () { @@ -2142,10 +2171,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." ); }); @@ -2154,10 +2183,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" ); }); @@ -2167,10 +2196,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" ); }); @@ -2183,21 +2212,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 bce78da0c63f..32d9365f8e18 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 b171cc95684b..b04ec5f92b67 100644 --- a/packages/engine/Specs/Scene/Vector3DTilePointsSpec.js +++ b/packages/engine/Specs/Scene/Vector3DTilePointsSpec.js @@ -70,8 +70,9 @@ 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 && @@ -99,7 +100,7 @@ describe( rectangle, minimumHeight, maximumHeight, - positions, + positions ) { const length = positions.length; const buffer = new Uint16Array(length * 3); @@ -144,7 +145,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -158,7 +159,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); return loadPoints(points) .then(function () { @@ -168,7 +169,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); }) @@ -191,7 +192,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 5); @@ -205,7 +206,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); const style = new Cesium3DTileStyle({ verticalOrigin: VerticalOrigin.BOTTOM, @@ -224,7 +225,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) { @@ -245,7 +246,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -258,7 +259,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); const features = []; const getFeature = mockTileset.getFeature; @@ -266,7 +267,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); @@ -304,7 +305,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const mockTilesetClone = clone(mockTileset); @@ -324,7 +325,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); const style = new Cesium3DTileStyle({ @@ -368,41 +369,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); } @@ -476,13 +477,13 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const mockTilesetClone = clone(mockTileset); const batchTable = new Cesium3DTileBatchTable( mockTilesetClone, - testOptions.length, + testOptions.length ); mockTilesetClone.batchTable = batchTable; @@ -501,7 +502,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); const styleOptions = {}; @@ -553,7 +554,7 @@ describe( if (defined(expectedCesium3DTileFeaturePropertyValue)) { expect(feature[cesium3DTileFeaturePropertyName]).toBeDefined(); expect(feature[cesium3DTileFeaturePropertyName]).toEqual( - expectedCesium3DTileFeaturePropertyValue, + expectedCesium3DTileFeaturePropertyValue ); } else { expect(feature[cesium3DTileFeaturePropertyName]).toBeUndefined(); @@ -575,7 +576,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 1); @@ -589,7 +590,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); const style = new Cesium3DTileStyle({ @@ -608,7 +609,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(); @@ -634,7 +635,7 @@ describe( rectangle, minHeight, maxHeight, - cartoPositions, + cartoPositions ); const batchTable = new Cesium3DTileBatchTable(mockTileset, 5); @@ -648,7 +649,7 @@ describe( rectangle: rectangle, minimumHeight: minHeight, maximumHeight: maxHeight, - }), + }) ); const style = new Cesium3DTileStyle({ verticalOrigin: VerticalOrigin.BOTTOM, @@ -698,5 +699,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 784e3f383c5e..ef14b4d4b60c 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 7626e6cc86d2..1ca2cffad46b 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 3806abc4facd..b400be14e290 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 c4ed9d8d417c..64673c2fadbe 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 fb52f06ddd46..339aa5ffefef 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 a18af60b5e2f..7ffeffb0e214 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 224fbc926397..943eb8d6b0cc 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 bfd80ac66e58..22aeedcd5b54 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 3c55516d198b..d41713eca959 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 965c256bcb1d..94762a25d0c6 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 c70e0dc1b73c..cd61469689eb 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 70835d7063b5..fe750f3c4347 100644 --- a/packages/engine/Specs/Scene/WebMapServiceImageryProviderSpec.js +++ b/packages/engine/Specs/Scene/WebMapServiceImageryProviderSpec.js @@ -91,18 +91,20 @@ 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(); @@ -119,17 +121,19 @@ 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(); @@ -146,18 +150,20 @@ 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(); @@ -174,18 +180,20 @@ 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(); @@ -202,18 +210,20 @@ 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(); @@ -230,18 +240,20 @@ 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(); @@ -258,17 +270,19 @@ 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(); @@ -285,17 +299,19 @@ 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(); @@ -312,18 +328,20 @@ 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(); @@ -355,7 +373,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 ); }); @@ -365,15 +383,17 @@ 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(); @@ -386,17 +406,19 @@ 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(); @@ -409,20 +431,22 @@ 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); @@ -435,17 +459,19 @@ 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); @@ -467,16 +493,18 @@ 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(); @@ -501,26 +529,28 @@ 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(); @@ -548,26 +578,28 @@ 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(); @@ -592,26 +624,28 @@ 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(); @@ -639,26 +673,28 @@ 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(); @@ -686,26 +722,28 @@ 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(); @@ -733,26 +771,28 @@ 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(); @@ -769,22 +809,24 @@ 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(); @@ -891,14 +933,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 @@ -936,7 +978,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -946,7 +988,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -960,7 +1002,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) ); }); }); @@ -978,7 +1020,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -988,7 +1030,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1017,7 +1059,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1027,7 +1069,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1056,7 +1098,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1066,7 +1108,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1095,7 +1137,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1105,7 +1147,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1134,7 +1176,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1144,7 +1186,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1173,7 +1215,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); Resource._DefaultImplementations.loadWithXhr( @@ -1183,7 +1225,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1251,7 +1293,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); expect(url).not.toContain("json"); @@ -1262,7 +1304,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1292,7 +1334,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); @@ -1307,7 +1349,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); } }; @@ -1336,7 +1378,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); expect(url).toContain("1.1.1"); @@ -1352,7 +1394,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1375,7 +1417,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); expect(url).not.toContain("1.1.1"); @@ -1391,7 +1433,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1411,7 +1453,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); expect(url).toContain("1.1.1"); @@ -1427,7 +1469,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; return provider.pickFeatures(0, 0, 0, 0.5, 0.5); @@ -1457,7 +1499,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); @@ -1472,7 +1514,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1495,7 +1537,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ) { expect(url).toContain("GetFeatureInfo"); if (url.indexOf(encodeURIComponent("text/html")) < 0) { @@ -1508,7 +1550,7 @@ describe("Scene/WebMapServiceImageryProvider", function () { data, headers, deferred, - overrideMimeType, + overrideMimeType ); }; @@ -1563,12 +1605,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 ); }; @@ -1618,12 +1660,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 ); }; @@ -1671,12 +1713,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 ); }; @@ -1729,12 +1771,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 f16abebc577c..755c238ad9f9 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,7 +190,8 @@ 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", @@ -207,10 +208,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" ); }); @@ -338,16 +339,18 @@ 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) { @@ -367,16 +370,18 @@ 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(); @@ -409,14 +414,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 @@ -466,12 +471,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 ); }; @@ -522,12 +527,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 ); }; @@ -575,12 +580,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 ); }; @@ -620,13 +625,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 ); }; @@ -663,13 +668,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 d1aea9c50b59..7ba353984ca8 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 0786e1f6b4f9..b4e849b001f8 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), - ); - return computeFlyToLocationForRectangle(rectangle, scene).then( - function (result) { - expect(result).toEqual(expectedResult); - expect( - computeFlyToLocationForRectangle._sampleTerrainMostDetailed, - ).not.toHaveBeenCalled(); - }, + scene.camera.getRectangleCameraCoordinates(rectangle) ); + 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), - ); - return computeFlyToLocationForRectangle(rectangle, scene).then( - function (result) { - expect(result).toEqual(expectedResult); - expect( - computeFlyToLocationForRectangle._sampleTerrainMostDetailed, - ).not.toHaveBeenCalled(); - }, + scene.camera.getRectangleCameraCoordinates(rectangle) ); + 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 a67c0b57d2c9..1b1ee0ee4a7a 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 95373c5a6aa5..baf821b911ba 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 83698881426f..085fe985cecc 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 df0e4d0c3502..06a29a30f4c5 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,8 +476,9 @@ 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"); @@ -488,7 +489,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)); @@ -504,7 +505,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"); @@ -558,8 +559,9 @@ 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"); @@ -642,7 +644,7 @@ describe("Scene/parseBatchTable", function () { return classProperty.name; }); expect(classPropertyNames.sort()).toEqual( - Object.keys(binaryBatchTable).sort(), + Object.keys(binaryBatchTable).sort() ); const properties = propertyAttribute.properties; @@ -696,24 +698,25 @@ 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. @@ -728,7 +731,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 e0cfb1881cc0..0f351ba9ec6a 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 e2b8c9383bdc..4b0915aa6f5e 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 2e6ea2a90bb5..0be881a18ee3 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 9c7720b086a7..b59261f86d4a 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 2e9e5d04d0e4..5d2990993a0b 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,7 +43,8 @@ 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", @@ -63,16 +64,19 @@ 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", @@ -80,7 +84,8 @@ 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", }, }; @@ -121,7 +126,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})`); } @@ -319,7 +324,7 @@ function SvgButton(svgElement, viewModel) { viewModel.command, "canExecute", this.setEnabled, - this, + this ), ]; } @@ -349,7 +354,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; } @@ -366,7 +371,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"); @@ -502,19 +507,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"); @@ -664,12 +669,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" ); } } @@ -753,22 +758,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); @@ -778,12 +783,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); @@ -910,7 +915,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor0, + gradientEnabledColor0 ), }, { @@ -918,7 +923,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "12%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor1, + gradientEnabledColor1 ), }, { @@ -926,7 +931,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "46%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor2, + gradientEnabledColor2 ), }, { @@ -934,7 +939,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "81%", "stop-color": makeColorString( buttonNormalBackColor, - gradientEnabledColor3, + gradientEnabledColor3 ), }, ], @@ -952,7 +957,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor0, + gradientEnabledColor0 ), }, { @@ -960,7 +965,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "12%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor1, + gradientEnabledColor1 ), }, { @@ -968,7 +973,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "46%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor2, + gradientEnabledColor2 ), }, { @@ -976,7 +981,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "81%", "stop-color": makeColorString( buttonHoverBackColor, - gradientEnabledColor3, + gradientEnabledColor3 ), }, ], @@ -994,7 +999,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor0, + gradientEnabledColor0 ), }, { @@ -1002,7 +1007,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "12%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor1, + gradientEnabledColor1 ), }, { @@ -1010,7 +1015,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "46%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor2, + gradientEnabledColor2 ), }, { @@ -1018,7 +1023,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "81%", "stop-color": makeColorString( buttonToggledBackColor, - gradientEnabledColor3, + gradientEnabledColor3 ), }, ], @@ -1036,7 +1041,7 @@ Animation.prototype.applyThemeChanges = function () { offset: "0%", "stop-color": makeColorString( buttonDisabledBackColor, - gradientDisabledColor0, + gradientDisabledColor0 ), }, { @@ -1044,7 +1049,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 f00e762cd677..864b0bc51e6f 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,12 +342,9 @@ 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 4c96ecb200f5..8f623f369e49 100644 --- a/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.css +++ b/packages/widgets/Source/BaseLayerPicker/BaseLayerPicker.css @@ -28,19 +28,14 @@ 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 { @@ -110,9 +105,7 @@ .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 0748df1688d2..a1ec026cca76 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 3297b1f97a56..1e35d2f25a9d 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,11 +269,12 @@ 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( @@ -288,7 +289,7 @@ function BaseLayerPickerViewModel(options) { ); this._globe.terrainProvider = terrainProvider; removeEventListener(); - }, + } ); } @@ -304,7 +305,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 4238fdb61446..ab5d7c60079c 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 2cf4b667b1cf..ca9e7b2be41b 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 9cd5cacff3bf..742434dc7361 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,77 +118,71 @@ 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( @@ -197,14 +191,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( @@ -213,8 +207,8 @@ function Cesium3DTilesInspector(container, scene) { 0, 1, 0.005, - "dynamicScreenSpaceErrorDensity", - ), + "dynamicScreenSpaceErrorDensity" + ) ); dynamicScreenSpaceErrorContainer.appendChild( createRangeInput( @@ -222,43 +216,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); @@ -271,13 +265,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); @@ -289,25 +283,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"); @@ -317,23 +311,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 6c95c7aa9df3..093545e1572b 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 085db17089d3..54129b654178 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 e1c391af3644..25eb458a661d 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 b03b1b49fe2c..4dd5a677ae76 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 eca4b52bce4e..15e01ec5ba1f 100644 --- a/packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js +++ b/packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js @@ -71,20 +71,17 @@ 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 fbcff4fad24a..c7ade60dfcb8 100644 --- a/packages/widgets/Source/Geocoder/Geocoder.css +++ b/packages/widgets/Source/Geocoder/Geocoder.css @@ -10,9 +10,7 @@ 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 37f438bb37e5..f6ab8080ea31 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 441031338431..97b48677a014 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 0f67ece61c05..342a7d8ab932 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 47fbc6fd049f..f1ab2f4b1255 100644 --- a/packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js +++ b/packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js @@ -2,10 +2,9 @@ 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 26899af2a8b4..5041c550418e 100644 --- a/packages/widgets/Source/InfoBox/InfoBox.css +++ b/packages/widgets/Source/InfoBox/InfoBox.css @@ -15,19 +15,14 @@ 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 5a4871249e28..82dda94f90c8 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 8fe28ca7b7ca..25e4d1326b85 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 beb556e803fc..736c4d2932d9 100644 --- a/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.css +++ b/packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.css @@ -12,9 +12,7 @@ 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 1babb8aa1c6d..05b7573eb54d 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 653c344c088c..5f0fd411344b 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 f9d26457d548..80e0ac1cf674 100644 --- a/packages/widgets/Source/ProjectionPicker/ProjectionPicker.css +++ b/packages/widgets/Source/ProjectionPicker/ProjectionPicker.css @@ -13,9 +13,7 @@ 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 { @@ -47,7 +45,5 @@ 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 c596245dc8fb..d1cc1dee8cae 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 7b370939c796..bf51b586a9af 100644 --- a/packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js +++ b/packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js @@ -86,15 +86,17 @@ 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 eb74f6091914..85ea7272233c 100644 --- a/packages/widgets/Source/SceneModePicker/SceneModePicker.css +++ b/packages/widgets/Source/SceneModePicker/SceneModePicker.css @@ -13,9 +13,7 @@ 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 { @@ -78,7 +76,5 @@ 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 83c028afc48a..3ab0c6465ef9 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 e5c9fe1cfa7b..a73a8ce5a723 100644 --- a/packages/widgets/Source/SelectionIndicator/SelectionIndicator.css +++ b/packages/widgets/Source/SelectionIndicator/SelectionIndicator.css @@ -5,9 +5,7 @@ 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 d123c03dc091..53c2ee83f9bf 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 e5d5c63137be..d6ba66c211ec 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 773f98dac73d..5ffe18660450 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 c2eb1c40d21f..581bb7a33731 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 de11a00d388d..0d2baec78599 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 f9e0e26e697d..c661df9cbd71 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 48bc9b9b6e7a..0c22bf11d8b4 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 21cc736d0813..1f5697fbb39e 100644 --- a/packages/widgets/Source/VRButton/VRButtonViewModel.js +++ b/packages/widgets/Source/VRButton/VRButtonViewModel.js @@ -149,12 +149,9 @@ 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 26983bdc3819..4b4f8cf35e26 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,8 +167,10 @@ 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; } @@ -202,7 +204,7 @@ function pickImageryLayerFeature(viewer, windowPosition) { if (defined(feature.position)) { const ecfPosition = viewer.scene.ellipsoid.cartographicToCartesian( feature.position, - cartesian3Scratch, + cartesian3Scratch ); entity.position = new ConstantPositionProperty(ecfPosition); } @@ -215,7 +217,7 @@ function pickImageryLayerFeature(viewer, windowPosition) { return; } viewer.selectedEntity = createNoFeaturesEntity(); - }, + } ); return loadingMessage; @@ -430,7 +432,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." ); } @@ -441,7 +443,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') @@ -549,7 +551,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to viewerContainer.appendChild(selectionIndicatorContainer); selectionIndicator = new SelectionIndicator( selectionIndicatorContainer, - scene, + scene ); } @@ -565,12 +567,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 ); } @@ -600,7 +602,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( geocoder.viewModel.search.beforeExecute, Viewer.prototype._clearObjects, - this, + this ); } @@ -621,7 +623,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to eventHelper.add( homeButton.viewModel.command.beforeExecute, Viewer.prototype._clearTrackedObject, - this, + this ); } @@ -631,7 +633,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'); @@ -655,11 +657,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, { @@ -674,7 +676,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]; } @@ -699,7 +701,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') @@ -723,7 +725,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; @@ -739,7 +741,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to container: toolbar, instructionsInitiallyVisible: defaultValue( options.navigationInstructionsInitiallyVisible, - showNavHelp, + showNavHelp ), }); } @@ -752,7 +754,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to viewerContainer.appendChild(animationContainer); animation = new Animation( animationContainer, - new AnimationViewModel(clockViewModel), + new AnimationViewModel(clockViewModel) ); } @@ -780,7 +782,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 @@ -796,7 +798,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to timeline.container.style.right = `${fullscreenContainer.clientWidth}px`; timeline.resize(); } - }, + } ); } @@ -822,7 +824,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to timeline.container.style.right = `${vrContainer.clientWidth}px`; timeline.resize(); } - }, + } ); vrModeSubscription = subscribeAndEvaluate( @@ -830,7 +832,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to "isVRMode", function (isVRMode) { enableVRUI(that, isVRMode); - }, + } ); } @@ -843,7 +845,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; @@ -894,12 +896,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. @@ -919,12 +921,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. @@ -950,11 +952,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 ); } @@ -1744,10 +1746,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 ); } @@ -1793,7 +1795,7 @@ Viewer.prototype.destroy = function () { this._timeline.removeEventListener( "settime", onTimelineScrubfunction, - false, + false ); this._element.removeChild(this._timeline.container); this._timeline = this._timeline.destroy(); @@ -1840,12 +1842,12 @@ Viewer.prototype.destroy = function () { */ Viewer.prototype._dataSourceAdded = function ( dataSourceCollection, - dataSource, + dataSource ) { const entityCollection = dataSource.entities; entityCollection.collectionChanged.addEventListener( Viewer.prototype._onEntityCollectionChanged, - this, + this ); }; @@ -1854,12 +1856,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)) { @@ -1896,7 +1898,7 @@ Viewer.prototype._onTick = function (clock) { const trackedState = this._dataSourceDisplay.getBoundingSphere( trackedEntity, false, - boundingSphereScratch, + boundingSphereScratch ); if (trackedState === BoundingSphereState.DONE) { entityView.update(time, boundingSphereScratch); @@ -1916,7 +1918,7 @@ Viewer.prototype._onTick = function (clock) { const state = this._dataSourceDisplay.getBoundingSphere( selectedEntity, true, - boundingSphereScratch, + boundingSphereScratch ); if (state !== BoundingSphereState.FAILED) { position = boundingSphereScratch.center; @@ -1932,7 +1934,7 @@ Viewer.prototype._onTick = function (clock) { if (defined(selectionIndicatorViewModel)) { selectionIndicatorViewModel.position = Cartesian3.clone( position, - selectionIndicatorViewModel.position, + selectionIndicatorViewModel.position ); selectionIndicatorViewModel.showSelection = showSelection && enableCamera; selectionIndicatorViewModel.update(); @@ -1950,12 +1952,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 = ""; @@ -1970,7 +1972,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++) { @@ -2040,7 +2042,7 @@ Viewer.prototype._onDataSourceChanged = function (dataSource) { */ Viewer.prototype._onDataSourceAdded = function ( dataSourceCollection, - dataSource, + dataSource ) { if (this._automaticallyTrackDataSourceClocks) { this.clockTrackedDataSource = dataSource; @@ -2049,7 +2051,7 @@ Viewer.prototype._onDataSourceAdded = function ( const removalFunc = this._eventHelper.add( dataSource.changedEvent, Viewer.prototype._onDataSourceChanged, - this, + this ); this._dataSourceChangedListeners[id] = removalFunc; }; @@ -2059,7 +2061,7 @@ Viewer.prototype._onDataSourceAdded = function ( */ Viewer.prototype._onDataSourceRemoved = function ( dataSourceCollection, - dataSource, + dataSource ) { const resetClock = this.clockTrackedDataSource === dataSource; const id = dataSource.entities.id; @@ -2069,7 +2071,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; @@ -2271,7 +2273,7 @@ function updateZoomTarget(viewer) { zoomOptions.offset = new HeadingPitchRange( 0.0, -0.5, - boundingSphere.radius, + boundingSphere.radius ); } @@ -2307,12 +2309,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; } @@ -2352,7 +2354,7 @@ function updateZoomTarget(viewer) { const state = viewer._dataSourceDisplay.getBoundingSphere( entities[i], false, - boundingSphereScratch, + boundingSphereScratch ); if (state === BoundingSphereState.PENDING) { @@ -2406,7 +2408,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)) { @@ -2418,7 +2420,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 c8cf827bdb08..1d6e985adc31 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 a5e0afe8c9e6..3d1ad208b481 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 6e11d882c7b0..24f6b896f50c 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 7cf771bc39e9..26871cfbe81e 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 8ecc04914113..317f57e6eed7 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,22 +720,21 @@ 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](); @@ -807,7 +806,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 6d32a2800417..510615498a98 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 751f31a47472..e90fc79319a5 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,7 +667,10 @@ 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 13bcc3ab7eda..f4ab2aeddf71 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 4a76b8ac8530..39ded525e04b 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 0442fde73347..51267ff50f61 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 8250282dfff1..b372cf789d59 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 29f535510379..b8d99c10c0a4 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 fbe1cd1b10d1..bcd1dded57a6 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 350e4fd4e7ba..259763916407 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 10909d425e1a..23a6a84b2743 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 4f2e5914947a..b66e9ee7b8a5 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 7bc9ffff6d81..131ea187b0fb 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,13 +85,14 @@ 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 08f8c8b1a667..8d8c22af3c4f 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 87becab3ad41..eb3131693caa 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 37392e430f2f..a6d37e6d4c36 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 111844304a47..7f737d46927c 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 5e422e037993..ce99a4b39cb3 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 aed794b5bed9..5982b23a72b7 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 123e4a9f217c..a311999f575c 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 81e1ca9ffeab..6bd6cefb22f4 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 fa768a458aab..c363ab246201 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 d68922c2afeb..360f38b9e8fc 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 ebb5ebab0197..ecc403fed5e8 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,11 +63,8 @@ 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 a8428eae1a3e..dc313e43702b 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,8 +726,9 @@ 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; @@ -748,8 +749,9 @@ 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); @@ -761,12 +763,15 @@ 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); }) @@ -776,12 +781,15 @@ 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); }) @@ -806,19 +814,22 @@ 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; @@ -846,8 +857,9 @@ 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, @@ -862,7 +874,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. @@ -872,12 +884,15 @@ 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); @@ -905,11 +920,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; @@ -923,11 +938,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(); }); }); @@ -946,7 +961,7 @@ describe( return !viewer.useDefaultRenderLoop; }).catch(function () { expect( - viewer._element.querySelector(".cesium-widget-errorPanel"), + viewer._element.querySelector(".cesium-widget-errorPanel") ).toBeNull(); }); }); @@ -965,7 +980,7 @@ describe( }); expect(viewer.scene.maximumRenderTimeChange).toBe( - Number.POSITIVE_INFINITY, + Number.POSITIVE_INFINITY ); }); @@ -975,7 +990,7 @@ describe( }); expect(viewer.scene._depthPlane._ellipsoidOffset).toBe( - Number.POSITIVE_INFINITY, + Number.POSITIVE_INFINITY ); }); @@ -984,7 +999,7 @@ describe( const entity = new Entity(); entity.position = new ConstantProperty( - new Cartesian3(123456, 123456, 123456), + new Cartesian3(123456, 123456, 123456) ); viewer.trackedEntity = entity; @@ -1002,7 +1017,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(123456, 123456, 123456), + new Cartesian3(123456, 123456, 123456) ); dataSource.entities.add(entity); @@ -1024,7 +1039,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(123456, 123456, 123456), + new Cartesian3(123456, 123456, 123456) ); dataSource.entities.add(entity); @@ -1050,7 +1065,7 @@ describe( const entity = new Entity(); entity.position = new ConstantPositionProperty( - new Cartesian3(123456, 123456, 123456), + new Cartesian3(123456, 123456, 123456) ); dataSource.entities.add(entity); @@ -1106,7 +1121,7 @@ describe( const entity = new Entity(); entity.position = new ConstantProperty( - new Cartesian3(123456, 123456, 123456), + new Cartesian3(123456, 123456, 123456) ); viewer.trackedEntity = entity; @@ -1128,7 +1143,7 @@ describe( const entity = new Entity(); entity.position = new ConstantProperty( - new Cartesian3(123456, 123456, 123456), + new Cartesian3(123456, 123456, 123456) ); const dataSource = new MockDataSource(); @@ -1144,9 +1159,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); @@ -1165,9 +1180,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); @@ -1221,17 +1236,18 @@ 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(); @@ -1252,18 +1268,19 @@ 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(); @@ -1286,11 +1303,12 @@ describe( }; } - const timeIntervalCollection = - TimeIntervalCollection.fromIso8601DateArray({ + const timeIntervalCollection = TimeIntervalCollection.fromIso8601DateArray( + { iso8601Dates: dates, dataCallback: dataCallback, - }); + } + ); const pointCloud = new TimeDynamicPointCloud({ intervals: timeIntervalCollection, @@ -1320,18 +1338,19 @@ 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(); @@ -1349,18 +1368,19 @@ 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(); @@ -1374,7 +1394,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); @@ -1389,18 +1409,19 @@ 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(); @@ -1418,18 +1439,19 @@ 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(); @@ -1457,17 +1479,18 @@ 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(); @@ -1496,14 +1519,15 @@ 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(); @@ -1558,15 +1582,16 @@ 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(); @@ -1587,15 +1612,16 @@ 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(); @@ -1621,14 +1647,15 @@ 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(); @@ -1643,15 +1670,16 @@ 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(); @@ -1669,15 +1697,16 @@ 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(); @@ -1700,14 +1729,15 @@ 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(); @@ -1725,15 +1755,16 @@ 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(); @@ -1751,15 +1782,16 @@ 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(); @@ -1784,14 +1816,15 @@ 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(); @@ -1819,16 +1852,17 @@ 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(); @@ -1858,15 +1892,16 @@ 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(); @@ -1884,15 +1919,16 @@ 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(); @@ -1917,14 +1953,15 @@ 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(); @@ -1954,16 +1991,17 @@ 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(); @@ -1997,16 +2035,17 @@ 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(); @@ -2038,16 +2077,17 @@ 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(); @@ -2077,13 +2117,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 882900e0b2b4..d730ac1f4136 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 fe64352157af..3526b0304dc5 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 b269e347787e..c2f12bd41369 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/scripts/build.js b/scripts/build.js index a28de85995a0..25c247c7210c 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -14,6 +14,7 @@ import { rimraf } from "rimraf"; import { mkdirp } from "mkdirp"; + // Determines the scope of the workspace packages. If the scope is set to cesium, the workspaces should be @cesium/engine. // This should match the scope of the dependencies of the root level package.json. const scope = "cesium"; @@ -80,6 +81,7 @@ const stripPragmaPlugin = { }, }; + // Print an esbuild warning function printBuildWarning({ location, text }) { const { column, file, line, lineText, suggestion } = location; @@ -111,7 +113,7 @@ export const defaultESBuildOptions = () => { color: true, legalComments: `inline`, logLimit: 0, - target: `es2020`, + target: `es2020` }; }; @@ -200,7 +202,6 @@ export async function bundleCesiumJs(options) { incremental: incremental, write: options.write, }); - const iife = await build({ ...buildConfig, format: "iife", @@ -330,6 +331,9 @@ export async function createCombinedSpecList() { return contents; } + + + /** * @param {object} options * @param {string} options.path output directory @@ -1133,6 +1137,7 @@ export async function buildCesium(options) { outbase: "packages/widgets/Source", }); + const workersContext = await bundleWorkers({ iife: false, minify: minify, diff --git a/server.js b/server.js index b5092672ce6f..057beb0f0d98 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,24 +254,21 @@ 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 @@ -296,8 +293,7 @@ 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) { @@ -364,7 +360,7 @@ async function generateDevelopmentBuild() { } res.status(code).send(body); - }, + } ); }); @@ -375,28 +371,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."); diff --git a/temp_wasm/cesiumjs-gsplat-utils/.appveyor.yml b/temp_wasm/cesiumjs-gsplat-utils/.appveyor.yml new file mode 100644 index 000000000000..50910bd6f38b --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/.appveyor.yml @@ -0,0 +1,11 @@ +install: + - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe + - if not defined RUSTFLAGS rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin + - rustc -V + - cargo -V + +build: false + +test_script: + - cargo test --locked diff --git a/temp_wasm/cesiumjs-gsplat-utils/.gitignore b/temp_wasm/cesiumjs-gsplat-utils/.gitignore new file mode 100644 index 000000000000..8d60eedca108 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/.gitignore @@ -0,0 +1,6 @@ +/target +**/*.rs.bk +Cargo.lock +bin/ + +wasm-pack.log diff --git a/temp_wasm/cesiumjs-gsplat-utils/.travis.yml b/temp_wasm/cesiumjs-gsplat-utils/.travis.yml new file mode 100644 index 000000000000..7a913256e853 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/.travis.yml @@ -0,0 +1,69 @@ +language: rust +sudo: false + +cache: cargo + +matrix: + include: + + # Builds with wasm-pack. + - rust: beta + env: RUST_BACKTRACE=1 + addons: + firefox: latest + chrome: stable + before_script: + - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update) + - (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate) + - cargo install-update -a + - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f + script: + - cargo generate --git . --name testing + # Having a broken Cargo.toml (in that it has curlies in fields) anywhere + # in any of our parent dirs is problematic. + - mv Cargo.toml Cargo.toml.tmpl + - cd testing + - wasm-pack build + - wasm-pack test --chrome --firefox --headless + + # Builds on nightly. + - rust: nightly + env: RUST_BACKTRACE=1 + before_script: + - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update) + - (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate) + - cargo install-update -a + - rustup target add wasm32-unknown-unknown + script: + - cargo generate --git . --name testing + - mv Cargo.toml Cargo.toml.tmpl + - cd testing + - cargo check + - cargo check --target wasm32-unknown-unknown + - cargo check --no-default-features + - cargo check --target wasm32-unknown-unknown --no-default-features + - cargo check --no-default-features --features console_error_panic_hook + - cargo check --target wasm32-unknown-unknown --no-default-features --features console_error_panic_hook + - cargo check --no-default-features --features "console_error_panic_hook wee_alloc" + - cargo check --target wasm32-unknown-unknown --no-default-features --features "console_error_panic_hook wee_alloc" + + # Builds on beta. + - rust: beta + env: RUST_BACKTRACE=1 + before_script: + - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update) + - (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate) + - cargo install-update -a + - rustup target add wasm32-unknown-unknown + script: + - cargo generate --git . --name testing + - mv Cargo.toml Cargo.toml.tmpl + - cd testing + - cargo check + - cargo check --target wasm32-unknown-unknown + - cargo check --no-default-features + - cargo check --target wasm32-unknown-unknown --no-default-features + - cargo check --no-default-features --features console_error_panic_hook + - cargo check --target wasm32-unknown-unknown --no-default-features --features console_error_panic_hook + # Note: no enabling the `wee_alloc` feature here because it requires + # nightly for now. diff --git a/temp_wasm/cesiumjs-gsplat-utils/Cargo.toml b/temp_wasm/cesiumjs-gsplat-utils/Cargo.toml new file mode 100644 index 000000000000..d78f113f37af --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "cesiumjs-gsplat-utils" +version = "0.1.0" +authors = ["Jason Sobotka <jason.sobotka@cesium.com>"] +edition = "2021" + + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +default = ["console_error_panic_hook"] + +[dependencies] +wasm-bindgen = "0.2.84" +js-sys = "0.3.72" +web-sys = { version="0.3.72", features=["console"]} + +# The `console_error_panic_hook` crate provides better debugging of panics by +# logging them with `console.error`. This is great for development, but requires +# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for +# code size when deploying. +console_error_panic_hook = { version = "0.1.7", optional = true } + +[dev-dependencies] +wasm-bindgen-test = "0.3.34" + +[profile.release] +# Tell `rustc` to optimize for small code size. +opt-level = 3 +lto = true +codegen-units = 1 diff --git a/temp_wasm/cesiumjs-gsplat-utils/LICENSE_APACHE b/temp_wasm/cesiumjs-gsplat-utils/LICENSE_APACHE new file mode 100644 index 000000000000..11069edd7901 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/LICENSE_APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/temp_wasm/cesiumjs-gsplat-utils/LICENSE_MIT b/temp_wasm/cesiumjs-gsplat-utils/LICENSE_MIT new file mode 100644 index 000000000000..cb6579ff34ee --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/LICENSE_MIT @@ -0,0 +1,25 @@ +Copyright (c) 2018 Jason Sobotka <jason.sobotka@cesium.com> + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/temp_wasm/cesiumjs-gsplat-utils/README.md b/temp_wasm/cesiumjs-gsplat-utils/README.md new file mode 100644 index 000000000000..6b684085003f --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/README.md @@ -0,0 +1,84 @@ +<div align="center"> + + <h1><code>wasm-pack-template</code></h1> + + <strong>A template for kick starting a Rust and WebAssembly project using <a href="https://github.com/rustwasm/wasm-pack">wasm-pack</a>.</strong> + + <p> + <a href="https://travis-ci.org/rustwasm/wasm-pack-template"><img src="https://img.shields.io/travis/rustwasm/wasm-pack-template.svg?style=flat-square" alt="Build Status" /></a> + </p> + + <h3> + <a href="https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html">Tutorial</a> + <span> | </span> + <a href="https://discordapp.com/channels/442252698964721669/443151097398296587">Chat</a> + </h3> + + <sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub> +</div> + +## About + +[**📚 Read this template tutorial! 📚**][template-docs] + +This template is designed for compiling Rust libraries into WebAssembly and +publishing the resulting package to NPM. + +Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other +templates and usages of `wasm-pack`. + +[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html +[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html + +## 🚴 Usage + +### 🐑 Use `cargo generate` to Clone this Template + +[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate) + +``` +cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project +cd my-project +``` + +### 🛠️ Build with `wasm-pack build` + +``` +wasm-pack build +``` + +### 🔬 Test in Headless Browsers with `wasm-pack test` + +``` +wasm-pack test --headless --firefox +``` + +### 🎁 Publish to NPM with `wasm-pack publish` + +``` +wasm-pack publish +``` + +## 🔋 Batteries Included + +* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating + between WebAssembly and JavaScript. +* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook) + for logging panic messages to the developer console. +* `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you + +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally +submitted for inclusion in the work by you, as defined in the Apache-2.0 +license, shall be dual licensed as above, without any additional terms or +conditions. diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/README.md b/temp_wasm/cesiumjs-gsplat-utils/pkg/README.md new file mode 100644 index 000000000000..6b684085003f --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/pkg/README.md @@ -0,0 +1,84 @@ +<div align="center"> + + <h1><code>wasm-pack-template</code></h1> + + <strong>A template for kick starting a Rust and WebAssembly project using <a href="https://github.com/rustwasm/wasm-pack">wasm-pack</a>.</strong> + + <p> + <a href="https://travis-ci.org/rustwasm/wasm-pack-template"><img src="https://img.shields.io/travis/rustwasm/wasm-pack-template.svg?style=flat-square" alt="Build Status" /></a> + </p> + + <h3> + <a href="https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html">Tutorial</a> + <span> | </span> + <a href="https://discordapp.com/channels/442252698964721669/443151097398296587">Chat</a> + </h3> + + <sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub> +</div> + +## About + +[**📚 Read this template tutorial! 📚**][template-docs] + +This template is designed for compiling Rust libraries into WebAssembly and +publishing the resulting package to NPM. + +Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other +templates and usages of `wasm-pack`. + +[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html +[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html + +## 🚴 Usage + +### 🐑 Use `cargo generate` to Clone this Template + +[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate) + +``` +cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project +cd my-project +``` + +### 🛠️ Build with `wasm-pack build` + +``` +wasm-pack build +``` + +### 🔬 Test in Headless Browsers with `wasm-pack test` + +``` +wasm-pack test --headless --firefox +``` + +### 🎁 Publish to NPM with `wasm-pack publish` + +``` +wasm-pack publish +``` + +## 🔋 Batteries Included + +* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating + between WebAssembly and JavaScript. +* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook) + for logging panic messages to the developer console. +* `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you + +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally +submitted for inclusion in the work by you, as defined in the Apache-2.0 +license, shall be dual licensed as above, without any additional terms or +conditions. diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils.d.ts b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils.d.ts new file mode 100644 index 000000000000..8dc04217ec97 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils.d.ts @@ -0,0 +1,164 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rots + * @param {Uint8Array} colors + * @param {number} count + * @returns {TextureData} + */ +export function generate_texture_from_attrs(positions: Float32Array, scales: Float32Array, rots: Float32Array, colors: Uint8Array, count: number): TextureData; +/** + * @param {GSplatData} data + */ +export function radix_sort_simd(data: GSplatData): void; +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {Float32Array} model_view + * @param {number} count + * @returns {Array<any>} + */ +export function radix_sort_gaussians_attrs(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, model_view: Float32Array, count: number): Array<any>; +/** + * @param {Float32Array} positions + * @param {Float32Array} model_view + * @param {number} texture_width + * @param {number} count + * @returns {Uint32Array} + */ +export function radix_sort_gaussians_indexes(positions: Float32Array, model_view: Float32Array, texture_width: number, count: number): Uint32Array; +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {number} count + * @returns {object} + */ +export function generate_splat_texture_from_attrs(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, count: number): object; +export class GSplatData { + free(): void; + /** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {Float32Array} model_view + * @param {number} count + */ + constructor(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, model_view: Float32Array, count: number); + /** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {Float32Array} model_view + * @param {number} count + * @returns {GSplatData} + */ + static fromFloat32Arrays(positions: Float32Array, scales: Float32Array, rotations: Float32Array, colors: Uint8Array, model_view: Float32Array, count: number): GSplatData; + /** + * @returns {Float32Array} + */ + getPositions(): Float32Array; + /** + * @returns {Float32Array} + */ + getScales(): Float32Array; + /** + * @returns {Float32Array} + */ + getRotations(): Float32Array; + /** + * @returns {Uint8Array} + */ + getColors(): Uint8Array; +} +export class GaussianSorter { + free(): void; + /** + * @param {number} max_count + */ + constructor(max_count: number); + /** + * @param {Uint8Array} memory_buffer + * @param {number} positions_offset + * @param {number} scales_offset + * @param {number} rotations_offset + * @param {number} colors_offset + * @param {Float32Array} model_view + * @param {number} count + */ + sortGaussians(memory_buffer: Uint8Array, positions_offset: number, scales_offset: number, rotations_offset: number, colors_offset: number, model_view: Float32Array, count: number): void; +} +export class TextureData { + free(): void; + /** + * @param {Uint32Array} data + * @param {number} width + * @param {number} height + * @returns {TextureData} + */ + static new(data: Uint32Array, width: number, height: number): TextureData; + readonly data: Uint32Array; + readonly height: number; + readonly width: number; +} + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly __wbg_texturedata_free: (a: number, b: number) => void; + readonly texturedata_data: (a: number) => Array; + readonly texturedata_width: (a: number) => number; + readonly texturedata_height: (a: number) => number; + readonly texturedata_new: (a: number, b: number, c: number, d: number) => number; + readonly generate_texture_from_attrs: (a: number, b: number, c: number, d: number, e: number) => Array; + readonly __wbg_gsplatdata_free: (a: number, b: number) => void; + readonly gsplatdata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number; + readonly gsplatdata_fromFloat32Arrays: (a: number, b: number, c: number, d: number, e: number, f: number) => Array; + readonly gsplatdata_getPositions: (a: number) => number; + readonly gsplatdata_getScales: (a: number) => number; + readonly gsplatdata_getRotations: (a: number) => number; + readonly gsplatdata_getColors: (a: number) => number; + readonly radix_sort_simd: (a: number) => Array; + readonly radix_sort_gaussians_attrs: (a: number, b: number, c: number, d: number, e: number, f: number) => Array; + readonly radix_sort_gaussians_indexes: (a: number, b: number, c: number, d: number) => Array; + readonly __wbg_gaussiansorter_free: (a: number, b: number) => void; + readonly gaussiansorter_new: (a: number) => number; + readonly gaussiansorter_sortGaussians: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => Array; + readonly generate_splat_texture_from_attrs: (a: number, b: number, c: number, d: number, e: number) => Array; + readonly __wbindgen_export_0: WebAssembly.Table; + readonly __wbindgen_free: (a: number, b: number, c: number) => void; + readonly __wbindgen_malloc: (a: number, b: number) => number; + readonly __externref_table_dealloc: (a: number) => void; + readonly __wbindgen_exn_store: (a: number) => void; + readonly __externref_table_alloc: () => number; + readonly __wbindgen_start: () => void; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. +* +* @returns {InitOutput} +*/ +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise<InitOutput>} +*/ +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>; diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils.js b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils.js new file mode 100644 index 000000000000..e5c808bbbe4d --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils.js @@ -0,0 +1,578 @@ +let wasm; + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +let cachedUint32ArrayMemory0 = null; + +function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; +} + +function getArrayU32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +let WASM_VECTOR_LEN = 0; + +function passArray32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getUint32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_0.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rots + * @param {Uint8Array} colors + * @param {number} count + * @returns {TextureData} + */ +export function generate_texture_from_attrs(positions, scales, rots, colors, count) { + const ret = wasm.generate_texture_from_attrs(positions, scales, rots, colors, count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return TextureData.__wrap(ret[0]); +} + +let cachedFloat32ArrayMemory0 = null; + +function getFloat32ArrayMemory0() { + if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) { + cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer); + } + return cachedFloat32ArrayMemory0; +} + +function passArrayF32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getFloat32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8ArrayMemory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function _assertClass(instance, klass) { + if (!(instance instanceof klass)) { + throw new Error(`expected instance of ${klass.name}`); + } + return instance.ptr; +} +/** + * @param {GSplatData} data + */ +export function radix_sort_simd(data) { + _assertClass(data, GSplatData); + const ret = wasm.radix_sort_simd(data.__wbg_ptr); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {Float32Array} model_view + * @param {number} count + * @returns {Array<any>} + */ +export function radix_sort_gaussians_attrs(positions, scales, rotations, colors, model_view, count) { + const ret = wasm.radix_sort_gaussians_attrs(positions, scales, rotations, colors, model_view, count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} + +/** + * @param {Float32Array} positions + * @param {Float32Array} model_view + * @param {number} texture_width + * @param {number} count + * @returns {Uint32Array} + */ +export function radix_sort_gaussians_indexes(positions, model_view, texture_width, count) { + const ret = wasm.radix_sort_gaussians_indexes(positions, model_view, texture_width, count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} + +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {number} count + * @returns {object} + */ +export function generate_splat_texture_from_attrs(positions, scales, rotations, colors, count) { + const ret = wasm.generate_splat_texture_from_attrs(positions, scales, rotations, colors, count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_0.set(idx, obj); + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +const GSplatDataFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_gsplatdata_free(ptr >>> 0, 1)); + +export class GSplatData { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(GSplatData.prototype); + obj.__wbg_ptr = ptr; + GSplatDataFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + GSplatDataFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_gsplatdata_free(ptr, 0); + } + /** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {Float32Array} model_view + * @param {number} count + */ + constructor(positions, scales, rotations, colors, model_view, count) { + const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayF32ToWasm0(scales, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayF32ToWasm0(rotations, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArray8ToWasm0(colors, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ptr4 = passArrayF32ToWasm0(model_view, wasm.__wbindgen_malloc); + const len4 = WASM_VECTOR_LEN; + const ret = wasm.gsplatdata_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, count); + this.__wbg_ptr = ret >>> 0; + GSplatDataFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Uint8Array} colors + * @param {Float32Array} model_view + * @param {number} count + * @returns {GSplatData} + */ + static fromFloat32Arrays(positions, scales, rotations, colors, model_view, count) { + const ret = wasm.gsplatdata_fromFloat32Arrays(positions, scales, rotations, colors, model_view, count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return GSplatData.__wrap(ret[0]); + } + /** + * @returns {Float32Array} + */ + getPositions() { + const ret = wasm.gsplatdata_getPositions(this.__wbg_ptr); + return ret; + } + /** + * @returns {Float32Array} + */ + getScales() { + const ret = wasm.gsplatdata_getScales(this.__wbg_ptr); + return ret; + } + /** + * @returns {Float32Array} + */ + getRotations() { + const ret = wasm.gsplatdata_getRotations(this.__wbg_ptr); + return ret; + } + /** + * @returns {Uint8Array} + */ + getColors() { + const ret = wasm.gsplatdata_getColors(this.__wbg_ptr); + return ret; + } +} + +const GaussianSorterFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_gaussiansorter_free(ptr >>> 0, 1)); + +export class GaussianSorter { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + GaussianSorterFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_gaussiansorter_free(ptr, 0); + } + /** + * @param {number} max_count + */ + constructor(max_count) { + const ret = wasm.gaussiansorter_new(max_count); + this.__wbg_ptr = ret >>> 0; + GaussianSorterFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {Uint8Array} memory_buffer + * @param {number} positions_offset + * @param {number} scales_offset + * @param {number} rotations_offset + * @param {number} colors_offset + * @param {Float32Array} model_view + * @param {number} count + */ + sortGaussians(memory_buffer, positions_offset, scales_offset, rotations_offset, colors_offset, model_view, count) { + const ptr0 = passArray8ToWasm0(memory_buffer, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayF32ToWasm0(model_view, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.gaussiansorter_sortGaussians(this.__wbg_ptr, ptr0, len0, positions_offset, scales_offset, rotations_offset, colors_offset, ptr1, len1, count); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } + } +} + +const TextureDataFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_texturedata_free(ptr >>> 0, 1)); + +export class TextureData { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(TextureData.prototype); + obj.__wbg_ptr = ptr; + TextureDataFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TextureDataFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_texturedata_free(ptr, 0); + } + /** + * @returns {Uint32Array} + */ + get data() { + const ret = wasm.texturedata_data(this.__wbg_ptr); + var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v1; + } + /** + * @returns {number} + */ + get width() { + const ret = wasm.texturedata_width(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + get height() { + const ret = wasm.texturedata_height(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {Uint32Array} data + * @param {number} width + * @param {number} height + * @returns {TextureData} + */ + static new(data, width, height) { + const ptr0 = passArray32ToWasm0(data, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.texturedata_new(ptr0, len0, width, height); + return TextureData.__wrap(ret); + } +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_number_new = function(arg0) { + const ret = arg0; + return ret; + }; + imports.wbg.__wbg_new_034f913e7636e987 = function() { + const ret = new Array(); + return ret; + }; + imports.wbg.__wbg_new_e69b5f66fda8f13c = function() { + const ret = new Object(); + return ret; + }; + imports.wbg.__wbg_push_36cf4d81d7da33d1 = function(arg0, arg1) { + const ret = arg0.push(arg1); + return ret; + }; + imports.wbg.__wbg_set_e864d25d9b399c9f = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(arg0, arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function(arg0) { + const ret = arg0.buffer; + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function(arg0, arg1, arg2) { + const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); + }; + imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_5f67057565ba35bf = function(arg0, arg1, arg2) { + const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_set_ee2653838c0bd646 = function(arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); + }; + imports.wbg.__wbg_length_4fffde3ebafcc274 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_fc445c2d308275d0 = function(arg0, arg1, arg2) { + const ret = new Float32Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_new_1da7377de0530afc = function(arg0) { + const ret = new Float32Array(arg0); + return ret; + }; + imports.wbg.__wbg_set_7d71c7d52113586f = function(arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); + }; + imports.wbg.__wbg_length_366f583a1aad1dab = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_newwithlength_76462a666eca145f = function(arg0) { + const ret = new Uint8Array(arg0 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithlength_45683f0f95fd0b21 = function(arg0) { + const ret = new Uint32Array(arg0 >>> 0); + return ret; + }; + imports.wbg.__wbg_newwithlength_fb5c9bf9e513fa46 = function(arg0) { + const ret = new Float32Array(arg0 >>> 0); + return ret; + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedFloat32ArrayMemory0 = null; + cachedUint32ArrayMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('cesiumjs_gsplat_utils_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.js b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.js new file mode 100644 index 000000000000..65a175501152 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.js @@ -0,0 +1,380 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +let cachedUint32ArrayMemory0 = null; + +function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; +} + +function getArrayU32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} + +let WASM_VECTOR_LEN = 0; + +function passArray32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getUint32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +let cachedFloat32ArrayMemory0 = null; + +function getFloat32ArrayMemory0() { + if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) { + cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer); + } + return cachedFloat32ArrayMemory0; +} + +function passArrayF32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getFloat32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8ArrayMemory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_0.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +/** + * @param {Float32Array} pos + * @param {Uint8Array} rgba + * @param {Float32Array} scale + * @param {Float32Array} rot + * @param {number} vertex_count + * @returns {TextureData} + */ +export function generate_texture_from_attrs(pos, rgba, scale, rot, vertex_count) { + const ptr0 = passArrayF32ToWasm0(pos, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayF32ToWasm0(scale, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArrayF32ToWasm0(rot, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ret = wasm.generate_texture_from_attrs(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, vertex_count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return TextureData.__wrap(ret[0]); +} + +/** + * @param {Uint8Array} buffer + * @param {number} vertex_count + * @returns {TextureData} + */ +export function generate_texture(buffer, vertex_count) { + const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.generate_texture(ptr0, len0, vertex_count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return TextureData.__wrap(ret[0]); +} + +function _assertClass(instance, klass) { + if (!(instance instanceof klass)) { + throw new Error(`expected instance of ${klass.name}`); + } + return instance.ptr; +} +/** + * @param {GSplatData} data + */ +export function radix_sort_simd(data) { + _assertClass(data, GSplatData); + wasm.radix_sort_simd(data.__wbg_ptr); +} + +/** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Float32Array} colors + * @param {Float32Array} model_view + * @param {number} count + * @returns {GSplatData} + */ +export function sort_graphics_data(positions, scales, rotations, colors, model_view, count) { + const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayF32ToWasm0(scales, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayF32ToWasm0(rotations, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArrayF32ToWasm0(colors, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ptr4 = passArrayF32ToWasm0(model_view, wasm.__wbindgen_malloc); + const len4 = WASM_VECTOR_LEN; + const ret = wasm.sort_graphics_data(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, count); + return GSplatData.__wrap(ret); +} + +export function greet() { + wasm.greet(); +} + +/** + * @param {SortParameters} params + */ +export function count_sort(params) { + _assertClass(params, SortParameters); + wasm.count_sort(params.__wbg_ptr); +} + +/** + * @param {Uint8Array} buffer + * @param {number} vertex_count + * @returns {TextureData} + */ +export function generate_splat_texture(buffer, vertex_count) { + const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.generate_splat_texture(ptr0, len0, vertex_count); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return TextureData.__wrap(ret[0]); +} + +/** + * @param {Float32Array} pos + * @param {Uint8Array} rgba + * @param {Float32Array} scale + * @param {Float32Array} rot + * @param {number} vertex_cnt + * @returns {TextureData} + */ +export function generate_splat_texture_from_attrs(pos, rgba, scale, rot, vertex_cnt) { + const ptr0 = passArrayF32ToWasm0(pos, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArray8ToWasm0(rgba, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayF32ToWasm0(scale, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArrayF32ToWasm0(rot, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ret = wasm.generate_splat_texture_from_attrs(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, vertex_cnt); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return TextureData.__wrap(ret[0]); +} + +const GSplatDataFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_gsplatdata_free(ptr >>> 0, 1)); + +export class GSplatData { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(GSplatData.prototype); + obj.__wbg_ptr = ptr; + GSplatDataFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + GSplatDataFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_gsplatdata_free(ptr, 0); + } + /** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Float32Array} colors + * @param {Float32Array} model_view + * @param {number} count + */ + constructor(positions, scales, rotations, colors, model_view, count) { + const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayF32ToWasm0(scales, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayF32ToWasm0(rotations, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArrayF32ToWasm0(colors, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ptr4 = passArrayF32ToWasm0(model_view, wasm.__wbindgen_malloc); + const len4 = WASM_VECTOR_LEN; + const ret = wasm.gsplatdata_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, count); + this.__wbg_ptr = ret >>> 0; + GSplatDataFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +const SortParametersFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_sortparameters_free(ptr >>> 0, 1)); + +export class SortParameters { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + SortParametersFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_sortparameters_free(ptr, 0); + } + /** + * @param {Float32Array} positions + * @param {Float32Array} scales + * @param {Float32Array} rotations + * @param {Float32Array} colors + * @param {Float32Array} model_view + * @param {number} count + */ + constructor(positions, scales, rotations, colors, model_view, count) { + const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayF32ToWasm0(scales, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayF32ToWasm0(rotations, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ptr3 = passArrayF32ToWasm0(colors, wasm.__wbindgen_malloc); + const len3 = WASM_VECTOR_LEN; + const ptr4 = passArrayF32ToWasm0(model_view, wasm.__wbindgen_malloc); + const len4 = WASM_VECTOR_LEN; + const ret = wasm.sortparameters_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, count); + this.__wbg_ptr = ret >>> 0; + SortParametersFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +const TextureDataFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_texturedata_free(ptr >>> 0, 1)); + +export class TextureData { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(TextureData.prototype); + obj.__wbg_ptr = ptr; + TextureDataFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TextureDataFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_texturedata_free(ptr, 0); + } + /** + * @returns {Uint32Array} + */ + get data() { + const ret = wasm.texturedata_data(this.__wbg_ptr); + var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v1; + } + /** + * @returns {number} + */ + get width() { + const ret = wasm.texturedata_width(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + get height() { + const ret = wasm.texturedata_height(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {Uint32Array} data + * @param {number} width + * @param {number} height + * @returns {TextureData} + */ + static new(data, width, height) { + const ptr0 = passArray32ToWasm0(data, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.texturedata_new(ptr0, len0, width, height); + return TextureData.__wrap(ret); + } +} + +export function __wbg_alert_abe635d522c06aef(arg0, arg1) { + alert(getStringFromWasm0(arg0, arg1)); +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.wasm b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.wasm new file mode 100644 index 000000000000..947fb2e18dbc Binary files /dev/null and b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.wasm differ diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.wasm.d.ts b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.wasm.d.ts new file mode 100644 index 000000000000..bcf54bed2cde --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/pkg/cesiumjs_gsplat_utils_bg.wasm.d.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export function __wbg_texturedata_free(a: number, b: number): void; +export function texturedata_data(a: number): Array; +export function texturedata_width(a: number): number; +export function texturedata_height(a: number): number; +export function texturedata_new(a: number, b: number, c: number, d: number): number; +export function generate_texture_from_attrs(a: number, b: number, c: number, d: number, e: number): Array; +export function __wbg_gsplatdata_free(a: number, b: number): void; +export function gsplatdata_new(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number): number; +export function gsplatdata_fromFloat32Arrays(a: number, b: number, c: number, d: number, e: number, f: number): Array; +export function gsplatdata_getPositions(a: number): number; +export function gsplatdata_getScales(a: number): number; +export function gsplatdata_getRotations(a: number): number; +export function gsplatdata_getColors(a: number): number; +export function radix_sort_simd(a: number): Array; +export function radix_sort_gaussians_attrs(a: number, b: number, c: number, d: number, e: number, f: number): Array; +export function radix_sort_gaussians_indexes(a: number, b: number, c: number, d: number): Array; +export function __wbg_gaussiansorter_free(a: number, b: number): void; +export function gaussiansorter_new(a: number): number; +export function gaussiansorter_sortGaussians(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): Array; +export function generate_splat_texture_from_attrs(a: number, b: number, c: number, d: number, e: number): Array; +export const __wbindgen_export_0: WebAssembly.Table; +export function __wbindgen_free(a: number, b: number, c: number): void; +export function __wbindgen_malloc(a: number, b: number): number; +export function __externref_table_dealloc(a: number): void; +export function __wbindgen_exn_store(a: number): void; +export function __externref_table_alloc(): number; +export function __wbindgen_start(): void; diff --git a/temp_wasm/cesiumjs-gsplat-utils/pkg/package.json b/temp_wasm/cesiumjs-gsplat-utils/pkg/package.json new file mode 100644 index 000000000000..451a533fe2fa --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/pkg/package.json @@ -0,0 +1,18 @@ +{ + "name": "cesiumjs-gsplat-utils", + "type": "module", + "collaborators": [ + "Jason Sobotka <jason.sobotka@cesium.com>" + ], + "version": "0.1.0", + "files": [ + "cesiumjs_gsplat_utils_bg.wasm", + "cesiumjs_gsplat_utils.js", + "cesiumjs_gsplat_utils.d.ts" + ], + "main": "cesiumjs_gsplat_utils.js", + "types": "cesiumjs_gsplat_utils.d.ts", + "sideEffects": [ + "./snippets/*" + ] +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/lib.rs b/temp_wasm/cesiumjs-gsplat-utils/src/lib.rs new file mode 100644 index 000000000000..f5d022df39d9 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/lib.rs @@ -0,0 +1,45 @@ +mod utils; +mod perf_timer; +mod textureGen; +//mod textureGen_simd; +mod radix_simd; + +use wasm_bindgen::prelude::*; +use js_sys::{Float32Array, Uint8Array, Uint32Array, Object}; + +#[wasm_bindgen] +extern "C" { + fn alert(s: &str); +} + +//reimplementation of our javascript count sort +#[derive(Clone, Copy)] +struct Matrix4([f32; 16]); + +#[wasm_bindgen] +pub fn generate_splat_texture_from_attrs( + positions: &Float32Array, + scales: &Float32Array, + rotations: &Float32Array, + colors: &Uint8Array, + count: usize +) -> Result<Object, JsValue> { + let texture_data = textureGen::generate_texture_from_attrs( + positions, + scales, + rotations, + colors, + count + )?; + + let js_data = Uint32Array::new_with_length((texture_data.width() * texture_data.height() * 4) as u32); + js_data.copy_from(&texture_data.data()); + + // Create a JavaScript object to hold both the data and dimensions + let result = Object::new(); + js_sys::Reflect::set(&result, &"data".into(), &js_data)?; + js_sys::Reflect::set(&result, &"width".into(), &(texture_data.width() as f64).into())?; + js_sys::Reflect::set(&result, &"height".into(), &(texture_data.height() as f64).into())?; + + Ok(result) +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/perf_timer.rs b/temp_wasm/cesiumjs-gsplat-utils/src/perf_timer.rs new file mode 100644 index 000000000000..4fa170ff285c --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/perf_timer.rs @@ -0,0 +1,76 @@ +use std::time::{Duration, Instant}; +use std::collections::HashMap; +use std::fmt; + +#[derive(Debug)] +pub struct Timer { + start: Instant, + splits: HashMap<String, Duration>, + last_split: Instant, +} + +impl Timer { + pub fn new() -> Self { + let now = Instant::now(); + Timer { + start: now, + splits: HashMap::new(), + last_split: now, + } + } + + pub fn split(&mut self, name: &str) { + let now = Instant::now(); + let duration = now.duration_since(self.last_split); + self.splits.insert(name.to_string(), duration); + self.last_split = now; + } + + pub fn elapsed(&self) -> Duration { + Instant::now().duration_since(self.start) + } + + pub fn get_split(&self, name: &str) -> Option<Duration> { + self.splits.get(name).copied() + } + + pub fn reset(&mut self) { + let now = Instant::now(); + self.start = now; + self.last_split = now; + self.splits.clear(); + } +} + +impl fmt::Display for Timer { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + writeln!(f, "Total time: {:?}", self.elapsed())?; + writeln!(f, "\nSplits:")?; + for (name, duration) in &self.splits { + writeln!(f, "{}: {:?}", name, duration)?; + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::thread::sleep; + + #[test] + fn test_basic_timing() { + let mut timer = Timer::new(); + + // Simulate some work + sleep(Duration::from_millis(100)); + timer.split("first_operation"); + + sleep(Duration::from_millis(50)); + timer.split("second_operation"); + + assert!(timer.get_split("first_operation").unwrap().as_millis() >= 100); + assert!(timer.get_split("second_operation").unwrap().as_millis() >= 50); + assert!(timer.elapsed().as_millis() >= 150); + } +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/radix.rs b/temp_wasm/cesiumjs-gsplat-utils/src/radix.rs new file mode 100644 index 000000000000..a61912e5e840 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/radix.rs @@ -0,0 +1,121 @@ +use wasm_bindgen::prelude::*; +mod radix_simd; + +#[wasm_bindgen] +impl radix_simd::GSplatData { + pub fn radix_sort(&mut self) { + // Calculate depths and store as integers + let mut depth_values: Vec<i32> = Vec::with_capacity(self.count); + let mut max_depth = f32::NEG_INFINITY; + let mut min_depth = f32::INFINITY; + + // Helper closure to calculate depth + let calc_depth = |i: usize| -> f32 { + let pos_idx = i * 3; + self.positions[pos_idx] * self.model_view[2] + + self.positions[pos_idx + 1] * self.model_view[6] + + self.positions[pos_idx + 2] * self.model_view[10] + }; + + // Calculate initial depths + for i in 0..self.count { + let depth = (calc_depth(i) * 4096.0) as i32; + depth_values.push(depth); + max_depth = max_depth.max(depth as f32); + min_depth = min_depth.min(depth as f32); + } + + // Normalize depths to positive values + let depth_offset = (-min_depth as i32); + for depth in depth_values.iter_mut() { + *depth += depth_offset; + } + + // Create index array to track original positions + let mut indices: Vec<u32> = (0..self.count as u32).collect(); + + // Temporary arrays for radix sort + let mut temp_depths = vec![0i32; self.count]; + let mut temp_indices = vec![0u32; self.count]; + + // Sort for each byte (4 bytes for 32-bit integer) + for shift in (0..32).step_by(8) { + let mut counts = [0u32; 256]; + + // Count frequencies + for &depth in depth_values.iter() { + let byte = ((depth >> shift) & 0xFF) as usize; + counts[byte] += 1; + } + + // Calculate starting positions + let mut total = 0; + for count in counts.iter_mut() { + let current = *count; + *count = total; + total += current; + } + + // Move items to correct position + for i in 0..self.count { + let byte = ((depth_values[i] >> shift) & 0xFF) as usize; + let pos = counts[byte] as usize; + counts[byte] += 1; + + temp_depths[pos] = depth_values[i]; + temp_indices[pos] = indices[i]; + } + + // Copy back + depth_values.copy_from_slice(&temp_depths); + indices.copy_from_slice(&temp_indices); + } + + // Create new arrays for sorted data + let mut new_positions = vec![0.0f32; self.positions.len()]; + let mut new_scales = vec![0.0f32; self.scales.len()]; + let mut new_rotations = vec![0.0f32; self.rotations.len()]; + let mut new_colors = vec![0.0f32; self.colors.len()]; + + // Rearrange attribute arrays based on sorted indices + for (i, &idx) in indices.iter().enumerate() { + let j = idx as usize; + + // Copy positions (3 components) + let pos_i = i * 3; + let pos_j = j * 3; + new_positions[pos_i] = self.positions[pos_j]; + new_positions[pos_i + 1] = self.positions[pos_j + 1]; + new_positions[pos_i + 2] = self.positions[pos_j + 2]; + + // Copy scales (3 components) + let scale_i = i * 3; + let scale_j = j * 3; + new_scales[scale_i] = self.scales[scale_j]; + new_scales[scale_i + 1] = self.scales[scale_j + 1]; + new_scales[scale_i + 2] = self.scales[scale_j + 2]; + + // Copy rotations (4 components) + let rot_i = i * 4; + let rot_j = j * 4; + new_rotations[rot_i] = self.rotations[rot_j]; + new_rotations[rot_i + 1] = self.rotations[rot_j + 1]; + new_rotations[rot_i + 2] = self.rotations[rot_j + 2]; + new_rotations[rot_i + 3] = self.rotations[rot_j + 3]; + + // Copy colors (4 components) + let color_i = i * 4; + let color_j = j * 4; + new_colors[color_i] = self.colors[color_j]; + new_colors[color_i + 1] = self.colors[color_j + 1]; + new_colors[color_i + 2] = self.colors[color_j + 2]; + new_colors[color_i + 3] = self.colors[color_j + 3]; + } + + // Update the original arrays with sorted data + self.positions = new_positions; + self.scales = new_scales; + self.rotations = new_rotations; + self.colors = new_colors; + } +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/radix_simd.rs b/temp_wasm/cesiumjs-gsplat-utils/src/radix_simd.rs new file mode 100644 index 000000000000..71d7ecfdfbf4 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/radix_simd.rs @@ -0,0 +1,808 @@ +use std::arch::wasm32::*; +use wasm_bindgen::prelude::*; +use js_sys::{Float32Array, Uint8Array, Uint32Array, WebAssembly}; +use wasm_bindgen::JsCast; +use web_sys::console; + +use crate::perf_timer; + +#[wasm_bindgen] +pub struct GSplatData { + positions: Vec<f32>, + scales: Vec<f32>, + rotations: Vec<f32>, + colors: Vec<u8>, + model_view: [f32; 16], + count: usize, +} + +#[wasm_bindgen] +impl GSplatData { + #[wasm_bindgen(constructor)] + pub fn new( + positions: Vec<f32>, + scales: Vec<f32>, + rotations: Vec<f32>, + colors: Vec<u8>, + model_view: Vec<f32>, + count: usize, + ) -> Self { + let mut model_view_array = [0.0; 16]; + model_view_array.copy_from_slice(&model_view); + + Self { + positions, + scales, + rotations, + colors, + model_view: model_view_array, + count, + } + } + + #[wasm_bindgen(js_name = fromFloat32Arrays)] + pub fn from_float32_arrays( + positions: Float32Array, + scales: Float32Array, + rotations: Float32Array, + colors: Uint8Array, + model_view: Float32Array, + count: usize, + ) -> Result<GSplatData, JsValue> { + if positions.length() as usize != count * 3 { + return Err(JsValue::from_str("Invalid positions length")); + } + if scales.length() as usize != count * 3 { + return Err(JsValue::from_str("Invalid scales length")); + } + if rotations.length() as usize != count * 4 { + return Err(JsValue::from_str("Invalid rotations length")); + } + if colors.length() as usize != count * 4 { + return Err(JsValue::from_str("Invalid colors length")); + } + if model_view.length() != 16 { + return Err(JsValue::from_str("Model view matrix must have 16 elements")); + } + + let positions: Vec<f32> = positions.to_vec(); + let scales: Vec<f32> = scales.to_vec(); + let rotations: Vec<f32> = rotations.to_vec(); + let colors: Vec<u8> = colors.to_vec(); + let model_view: Vec<f32> = model_view.to_vec(); + + Ok(GSplatData::new( + positions, + scales, + rotations, + colors, + model_view, + count, + )) + } + + #[wasm_bindgen(js_name = getPositions)] + pub fn get_positions(&self) -> Float32Array { + let result = Float32Array::new_with_length(self.positions.len() as u32); + result.copy_from(&self.positions[..]); + result + } + + #[wasm_bindgen(js_name = getScales)] + pub fn get_scales(&self) -> Float32Array { + let result = Float32Array::new_with_length(self.scales.len() as u32); + result.copy_from(&self.scales[..]); + result + } + + #[wasm_bindgen(js_name = getRotations)] + pub fn get_rotations(&self) -> Float32Array { + let result = Float32Array::new_with_length(self.rotations.len() as u32); + result.copy_from(&self.rotations[..]); + result + } + + #[wasm_bindgen(js_name = getColors)] + pub fn get_colors(&self) -> Uint8Array { + let result = Uint8Array::new_with_length(self.colors.len() as u32); + result.copy_from(&self.colors[..]); + result + } +} + +#[target_feature(enable = "simd128")] +unsafe fn compute_depths_simd(positions: &[f32], model_view: &[f32], count: usize) -> Vec<i32> { + let mut depths = Vec::with_capacity(count); + let simd_count = count - (count % 4); + + let scale = f32x4(4096.0, 4096.0, 4096.0, 4096.0); + let mv2 = f32x4_splat(model_view[2]); + let mv6 = f32x4_splat(model_view[6]); + let mv10 = f32x4_splat(model_view[10]); + + for chunk_idx in (0..simd_count).step_by(4) { + let base_idx = chunk_idx * 3; + if base_idx + 11 >= positions.len() { + break; + } + + let pos = v128_load(positions[base_idx..].as_ptr() as *const v128); + let mut depth = f32x4_mul(pos, mv2); + + let pos_y = v128_load(positions[base_idx + 4..].as_ptr() as *const v128); + depth = f32x4_add(depth, f32x4_mul(pos_y, mv6)); + + let pos_z = v128_load(positions[base_idx + 8..].as_ptr() as *const v128); + depth = f32x4_add(depth, f32x4_mul(pos_z, mv10)); + + let depth_scaled = f32x4_mul(depth, scale); + let depth_int = i32x4_trunc_sat_f32x4(depth_scaled); + + let mut result = [0i32; 4]; + v128_store(result.as_mut_ptr() as *mut v128, depth_int); + depths.extend_from_slice(&result); + } + + let remainder_start = (count / 4) * 4; + for i in remainder_start..count { + let idx = i * 3; + if idx + 2 < positions.len() { + let depth = positions[idx] * model_view[2] + + positions[idx + 1] * model_view[6] + + positions[idx + 2] * model_view[10]; + depths.push((depth * 4096.0) as i32); + } + } + + depths.truncate(count); + depths +} + +#[target_feature(enable = "simd128")] +unsafe fn reorder_attributes_simd(data: &mut GSplatData, indices: &[u32]) { + let mut new_positions = vec![0.0; data.positions.len()]; + let mut new_scales = vec![0.0; data.scales.len()]; + let mut new_rotations = vec![0.0; data.rotations.len()]; + let mut new_colors = vec![0; data.colors.len()]; + + for (new_idx, &old_idx) in indices.iter().enumerate() { + let old_idx = old_idx as usize; + + if old_idx * 3 + 2 >= data.positions.len() || + new_idx * 3 + 2 >= new_positions.len() { + break; + } + + let pos_idx = new_idx * 3; + let old_pos_idx = old_idx * 3; + new_positions[pos_idx..pos_idx + 3] + .copy_from_slice(&data.positions[old_pos_idx..old_pos_idx + 3]); + + if old_idx * 3 + 2 >= data.scales.len() || + new_idx * 3 + 2 >= new_scales.len() { + break; + } + + let scale_idx = new_idx * 3; + let old_scale_idx = old_idx * 3; + new_scales[scale_idx..scale_idx + 3] + .copy_from_slice(&data.scales[old_scale_idx..old_scale_idx + 3]); + + if old_idx * 4 + 3 >= data.rotations.len() || + new_idx * 4 + 3 >= new_rotations.len() { + break; + } + + let rot_idx = new_idx * 4; + let old_rot_idx = old_idx * 4; + new_rotations[rot_idx..rot_idx + 4] + .copy_from_slice(&data.rotations[old_rot_idx..old_rot_idx + 4]); + + if old_idx * 4 + 3 >= data.colors.len() || + new_idx * 4 + 3 >= new_colors.len() { + break; + } + + let color_idx = new_idx * 4; + let old_color_idx = old_idx * 4; + new_colors[color_idx..color_idx + 4] + .copy_from_slice(&data.colors[old_color_idx..old_color_idx + 4]); + } + + data.positions = new_positions; + data.scales = new_scales; + data.rotations = new_rotations; + data.colors = new_colors; +} + +#[wasm_bindgen] +pub fn radix_sort_simd(data: &mut GSplatData) -> Result<(), JsValue> { + let count = data.count; + + if count * 3 > data.positions.len() || + count * 3 > data.scales.len() || + count * 4 > data.rotations.len() || + count * 4 > data.colors.len() { + return Err(JsValue::from_str("Invalid input sizes")); + } + + let mut depths = unsafe { + compute_depths_simd(&data.positions, &data.model_view, count) + }; + let mut indices: Vec<u32> = (0..count as u32).collect(); + + let mut temp_depths = vec![0i32; count]; + let mut temp_indices = vec![0u32; count]; + + for shift in (0..32).step_by(8) { + let mut counts = [0u32; 256]; + + unsafe { count_frequencies_simd(&depths, shift, &mut counts) }; + + let mut total = 0u32; + for count in counts.iter_mut() { + let current = *count; + *count = total; + total += current; + } + + unsafe { + scatter_elements_simd( + &depths, + &indices, + shift, + &counts, + &mut temp_depths, + &mut temp_indices + ) + }; + std::mem::swap(&mut depths, &mut temp_depths); + std::mem::swap(&mut indices, &mut temp_indices); + } + + unsafe { reorder_attributes_simd(data, &indices) }; + Ok(()) +} + +#[target_feature(enable = "simd128")] +unsafe fn count_frequencies_simd(depths: &[i32], shift: u32, counts: &mut [u32; 256]) { + unsafe { + let mask = i32x4_splat(0xFF); + + for chunk in depths.chunks_exact(4) { + let values = v128_load(chunk.as_ptr() as *const v128); + let shifted = i32x4_shr(values, shift); + let bytes = v128_and(shifted as v128, mask); + + let mut result = [0i32; 4]; + v128_store(result.as_mut_ptr() as *mut v128, bytes); + + for &value in &result { + counts[value as usize] += 1; + } + } + } + + for &depth in depths.chunks_exact(4).remainder() { + let byte = ((depth >> shift) & 0xFF) as usize; + counts[byte] += 1; + } +} + +#[target_feature(enable = "simd128")] +unsafe fn scatter_elements_simd( + depths: &[i32], + indices: &[u32], + shift: u32, + counts: &[u32; 256], + temp_depths: &mut [i32], + temp_indices: &mut [u32], +) { + let mut offsets = counts.to_owned(); + + for (&depth, &index) in depths.iter().zip(indices.iter()) { + let byte = ((depth >> shift) & 0xFF) as usize; + let pos = offsets[byte] as usize; + + temp_depths[pos] = depth; + temp_indices[pos] = index; + + offsets[byte] += 1; + } +} + +#[wasm_bindgen] +pub fn radix_sort_gaussians_attrs( + positions: &Float32Array, + scales: &Float32Array, + rotations: &Float32Array, + colors: &Uint8Array, + model_view: &Float32Array, + count: usize, +) -> Result<js_sys::Array, JsValue> { + if positions.length() as usize != count * 3 + || scales.length() as usize != count * 3 + || rotations.length() as usize != count * 4 + || colors.length() as usize != count * 4 + || model_view.length() != 16 { + return Err(JsValue::from_str("Invalid array lengths")); + } + + //set capacity first + let positions_vec = positions.to_vec(); + let model_view_vec = model_view.to_vec(); + + let mut depth_values = vec![0i32; count]; + let mut max_depth = f32::NEG_INFINITY; + let mut min_depth = f32::INFINITY; + + for i in 0..count { + let depth = positions_vec[i * 3] * model_view_vec[2] + + positions_vec[i * 3 + 1] * model_view_vec[6] + + positions_vec[i * 3 + 2] * model_view_vec[10]; + + let depth_int = (depth * 4096.0) as i32; + depth_values[i] = depth_int; + max_depth = max_depth.max(depth_int as f32); + min_depth = min_depth.min(depth_int as f32); + } + + let depth_offset = (-min_depth) as i32; + for depth in depth_values.iter_mut() { + *depth += depth_offset; + } + + let mut indices: Vec<u32> = (0..count as u32).collect(); + let mut temp_depths = vec![0i32; count]; + let mut temp_indices = vec![0u32; count]; + + for shift in (0..32).step_by(8) { + let mut counts = [0u32; 256]; + + for &depth in depth_values.iter() { + let byte = ((depth >> shift) & 0xFF) as usize; + counts[byte] += 1; + } + + let mut total = 0; + for count in counts.iter_mut() { + let current = *count; + *count = total; + total += current; + } + + for i in 0..count { + let byte = ((depth_values[i] >> shift) & 0xFF) as usize; + let pos = counts[byte] as usize; + counts[byte] += 1; + + temp_depths[pos] = depth_values[i]; + temp_indices[pos] = indices[i]; + } + + depth_values.copy_from_slice(&temp_depths); + indices.copy_from_slice(&temp_indices); + } + + let mut new_positions: Vec<f32> = vec![0.0; count * 3]; + let mut new_scales: Vec<f32> = vec![0.0; count * 3]; + let mut new_rotations: Vec<f32> = vec![0.0; count * 4]; + let mut new_colors: Vec<u8> = vec![0; count * 4]; + + let scales_vec = scales.to_vec(); + let rotations_vec = rotations.to_vec(); + let colors_vec = colors.to_vec(); + + for i in 0..count { + let j = indices[i] as usize; + + new_positions[i * 3] = positions_vec[j * 3]; + new_positions[i * 3 + 1] = positions_vec[j * 3 + 1]; + new_positions[i * 3 + 2] = positions_vec[j * 3 + 2]; + + new_scales[i * 3] = scales_vec[j * 3]; + new_scales[i * 3 + 1] = scales_vec[j * 3 + 1]; + new_scales[i * 3 + 2] = scales_vec[j * 3 + 2]; + + new_rotations[i * 4] = rotations_vec[j * 4]; + new_rotations[i * 4 + 1] = rotations_vec[j * 4 + 1]; + new_rotations[i * 4 + 2] = rotations_vec[j * 4 + 2]; + new_rotations[i * 4 + 3] = rotations_vec[j * 4 + 3]; + + new_colors[i * 4] = colors_vec[j * 4]; + new_colors[i * 4 + 1] = colors_vec[j * 4 + 1]; + new_colors[i * 4 + 2] = colors_vec[j * 4 + 2]; + new_colors[i * 4 + 3] = colors_vec[j * 4 + 3]; + } + + let new_positions_array = Float32Array::new_with_length(count as u32 * 3); + new_positions_array.copy_from(&new_positions[..]); + + let new_scales_array = Float32Array::new_with_length(count as u32 * 3); + new_scales_array.copy_from(&new_scales[..]); + + let new_rotations_array = Float32Array::new_with_length(count as u32 * 4); + new_rotations_array.copy_from(&new_rotations[..]); + + let new_colors_array = Uint8Array::new_with_length(count as u32 * 4); + new_colors_array.copy_from(&new_colors[..]); + + let result = js_sys::Array::new(); + result.push(&new_positions_array); + result.push(&new_scales_array); + result.push(&new_rotations_array); + result.push(&new_colors_array); + + Ok(result) +} + + +#[wasm_bindgen] +pub fn radix_sort_gaussians_indexes( + positions: &Float32Array, + model_view: &Float32Array, + texture_width: u32, + count: usize, +) -> Result<js_sys::Uint32Array, JsValue> { + if positions.length() as usize != count * 3 { + return Err(JsValue::from_str("Invalid positions length")); + } + if model_view.length() != 16 { + return Err(JsValue::from_str("Invalid model_view length")); + } + + let positions_vec = positions.to_vec(); + let model_view_vec = model_view.to_vec(); + let mut depth_values = vec![0i32; count]; + let mut max_depth = f32::NEG_INFINITY; + let mut min_depth = f32::INFINITY; + + for i in 0..count { + let depth = positions_vec[i * 3] * model_view_vec[2] + + positions_vec[i * 3 + 1] * model_view_vec[6] + + positions_vec[i * 3 + 2] * model_view_vec[10]; + + let depth_int = (depth * 4096.0) as i32; + depth_values[i] = depth_int; + max_depth = max_depth.max(depth_int as f32); + min_depth = min_depth.min(depth_int as f32); + } + + let depth_offset = (-min_depth) as i32; + for depth in depth_values.iter_mut() { + *depth += depth_offset; + } + + let mut indices: Vec<u32> = (0..count as u32).collect(); + let mut temp_depths = vec![0i32; count]; + let mut temp_indices = vec![0u32; count]; + + for shift in (0..32).step_by(8) { + let mut counts = [0u32; 256]; + + for &depth in depth_values.iter() { + let byte = ((depth >> shift) & 0xFF) as usize; + counts[byte] += 1; + } + + let mut total = 0; + for count in counts.iter_mut() { + let current = *count; + *count = total; + total += current; + } + + for i in 0..count { + let byte = ((depth_values[i] >> shift) & 0xFF) as usize; + let pos = counts[byte] as usize; + counts[byte] += 1; + + temp_depths[pos] = depth_values[i]; + temp_indices[pos] = indices[i]; + } + + depth_values.copy_from_slice(&temp_depths); + indices.copy_from_slice(&temp_indices); + } + + let indices_array = Uint32Array::new_with_length(count as u32); + indices_array.copy_from(&indices); + + Ok(indices_array) +} + +#[wasm_bindgen] +pub fn radix_sort_gaussians_indexes_simd( + positions: &Float32Array, + model_view: &Float32Array, + texture_width: u32, + count: usize, +) -> Result<js_sys::Uint32Array, JsValue> { + if positions.length() as usize != count * 3 || model_view.length() != 16 { + return Err(JsValue::from_str("Invalid input lengths")); + } + + let positions_vec = positions.to_vec(); + let mv = model_view.to_vec(); + + // Convert positions to SIMD vectors + let mv_row = v128_load(&[mv[2], mv[6], mv[10], 0.0]); + let mut depth_values = vec![0i32; count]; + let mut max_depth = f32::NEG_INFINITY; + let mut min_depth = f32::INFINITY; + + // Process 4 points at a time + for chunk in (0..count).step_by(4) { + let remaining = count - chunk; + if remaining >= 4 { + let pos0 = v128_load(&positions_vec[chunk * 3..]); + let pos1 = v128_load(&positions_vec[chunk * 3 + 4..]); + let pos2 = v128_load(&positions_vec[chunk * 3 + 8..]); + + // Compute depths using SIMD dot product + let depths = f32x4_dot_product( + v128_shuffle::<0, 1, 2, 2>(pos0, pos1), + mv_row + ); + + // Convert to fixed point and store + let depth_ints = f32x4_convert_to_i32x4(f32x4_mul(depths, f32x4_splat(4096.0))); + depth_values[chunk..chunk + 4].copy_from_slice(&i32x4_extract_values(depth_ints)); + + // Update min/max using SIMD + max_depth = f32x4_extract_lane::<0>(f32x4_max(f32x4_splat(max_depth), depths)); + min_depth = f32x4_extract_lane::<0>(f32x4_min(f32x4_splat(min_depth), depths)); + } else { + // Handle remaining points sequentially + for i in chunk..count { + let depth = positions_vec[i * 3] * mv[2] + + positions_vec[i * 3 + 1] * mv[6] + + positions_vec[i * 3 + 2] * mv[10]; + depth_values[i] = (depth * 4096.0) as i32; + max_depth = max_depth.max(depth); + min_depth = min_depth.min(depth); + } + } + } + + let depth_offset = (-min_depth * 4096.0) as i32; + for depth in depth_values.iter_mut() { + *depth += depth_offset; + } + + let mut indices: Vec<u32> = (0..count as u32).collect(); + let mut temp_depths = vec![0i32; count]; + let mut temp_indices = vec![0u32; count]; + + for shift in (0..32).step_by(8) { + let mut counts = [0u32; 256]; + + for chunk in depth_values.chunks(4) { + let depths = if chunk.len() == 4 { + i32x4_load(chunk) + } else { + let mut padded = [0i32; 4]; + padded[..chunk.len()].copy_from_slice(chunk); + i32x4_load(&padded) + }; + + // let bytes = i32x4_shr(depths, i32x4_splat(shift)); + // let masked = v128_and(bytes, i32x4_splat(0xFF)); + + // i8x16_extract_lane::<0>() + // let b1 = i32x4_extract_lane::<0>(masked) & 0xFF; + // let b2 = i32x4_extract_lane::<0>(masked) & 0xFF; + // let b3 = i32x4_extract_lane::<0>(masked) & 0xFF; + // let b4 = i32x4_extract_lane::<0>(masked) & 0xFF; + // counts[b1] += 1; + // counts[b2] += 1; + // counts[b3] += 1; + // counts[b4] += 1; + // for i in 0..chunk.len() { + // let byte = i32x4_extract_lane::<0>(i32x4_shuffle::<i, i, i, i>(masked, masked)) as usize; + // counts[byte] += 1; + // } + } + + let mut total = 0; + for count in counts.iter_mut() { + let current = *count; + *count = total; + total += current; + } + + for i in 0..count { + let byte = ((depth_values[i] >> shift) & 0xFF) as usize; + let pos = counts[byte] as usize; + counts[byte] += 1; + + temp_depths[pos] = depth_values[i]; + temp_indices[pos] = indices[i]; + } + + depth_values.copy_from_slice(&temp_depths); + indices.copy_from_slice(&temp_indices); + } + + let indices_array = Uint32Array::new_with_length(count as u32); + indices_array.copy_from(&indices); + Ok(indices_array) +} + +#[inline] +fn v128_load(slice: &[f32]) -> v128 { + unsafe { v128_load(slice.as_ptr() as *const v128) } +} + +#[inline] +fn i32x4_load(slice: &[i32]) -> v128 { + unsafe { v128_load(slice.as_ptr() as *const v128) } +} + +#[inline] +fn f32x4_dot_product(a: v128, b: v128) -> v128 { + unsafe { + let mul = f32x4_mul(a, b); + f32x4_add( + f32x4_add( + f32x4_extract_lane::<0>(mul), + f32x4_extract_lane::<1>(mul) + ), + f32x4_add( + f32x4_extract_lane::<2>(mul), + f32x4_extract_lane::<3>(mul) + ) + ) + } +} + +#[inline] +fn i32x4_extract_values(v: v128) -> [i32; 4] { + unsafe { + [ + i32x4_extract_lane::<0>(v), + i32x4_extract_lane::<1>(v), + i32x4_extract_lane::<2>(v), + i32x4_extract_lane::<3>(v) + ] + } +} + +#[wasm_bindgen(js_name = "GaussianSorter")] +pub struct GaussianSorter { + indices: Vec<u32>, + temp_indices: Vec<u32>, + depth_values: Vec<i32>, + counts: [u32; 256], + temp_positions: Vec<f32>, + temp_scales: Vec<f32>, + temp_rotations: Vec<f32>, + temp_colors: Vec<u8>, +} + +#[wasm_bindgen(js_class = "GaussianSorter")] +impl GaussianSorter { + #[wasm_bindgen(constructor)] + pub fn new(max_count: usize) -> Self { + Self { + indices: Vec::with_capacity(max_count), + temp_indices: vec![0u32; max_count], + depth_values: vec![0i32; max_count], + counts: [0u32; 256], + temp_positions: vec![0.0; max_count * 3], + temp_scales: vec![0.0; max_count * 3], + temp_rotations: vec![0.0; max_count * 4], + temp_colors: vec![0; max_count * 4], + } + } + + //"in-place" attempt, memory buffer is in the wrong context + #[wasm_bindgen(js_name = "sortGaussians")] + pub fn sort_gaussians( + &mut self, + memory_buffer: &[u8], + positions_offset: u32, + scales_offset: u32, + rotations_offset: u32, + colors_offset: u32, + model_view: &[f32], + count: usize, + ) -> Result<(), JsValue> { + let positions = unsafe { std::slice::from_raw_parts( + memory_buffer.as_ptr().add(positions_offset as usize) as *const f32, + count * 3 + )}; + let scales = unsafe { std::slice::from_raw_parts( + memory_buffer.as_ptr().add(scales_offset as usize) as *const f32, + count * 3 + )}; + let rotations = unsafe { std::slice::from_raw_parts( + memory_buffer.as_ptr().add(rotations_offset as usize) as *const f32, + count * 4 + )}; + let colors = unsafe { std::slice::from_raw_parts( + memory_buffer.as_ptr().add(colors_offset as usize) as *const u8, + count * 4 + )}; + + let mv2 = model_view[2]; + let mv6 = model_view[6]; + let mv10 = model_view[10]; + let mv14 = model_view[14]; + + let mut max_depth = f32::NEG_INFINITY; + let mut min_depth = f32::INFINITY; + + for i in 0..count { + let x = positions[i * 3]; + let y = positions[i * 3 + 1]; + let z = positions[i * 3 + 2]; + + let depth = x * mv2 + y * mv6 + z * mv10 + mv14; + let depth_int = (depth * 4096.0) as i32; + self.depth_values[i] = depth_int; + max_depth = max_depth.max(depth_int as f32); + min_depth = min_depth.min(depth_int as f32); + } + + self.indices.clear(); + self.indices.extend(0..count as u32); + + for shift in (0..32).step_by(8) { + self.counts.fill(0); + + for &depth in self.depth_values.iter().take(count) { + let byte = ((depth >> shift) & 0xFF) as usize; + self.counts[byte] += 1; + } + + let mut total = 0; + for count in self.counts.iter_mut() { + let current = *count; + *count = total; + total += current; + } + + for i in 0..count { + let byte = ((self.depth_values[i] >> shift) & 0xFF) as usize; + let pos = self.counts[byte] as usize; + self.counts[byte] += 1; + self.temp_indices[pos] = self.indices[i]; + } + + self.indices[..count].copy_from_slice(&self.temp_indices[..count]); + } + + for i in 0..count { + let j = self.indices[i] as usize; + self.temp_positions[i * 3..(i + 1) * 3].copy_from_slice(&positions[j * 3..(j + 1) * 3]); + self.temp_scales[i * 3..(i + 1) * 3].copy_from_slice(&scales[j * 3..(j + 1) * 3]); + self.temp_rotations[i * 4..(i + 1) * 4].copy_from_slice(&rotations[j * 4..(j + 1) * 4]); + self.temp_colors[i * 4..(i + 1) * 4].copy_from_slice(&colors[j * 4..(j + 1) * 4]); + } + + let positions_out = unsafe { std::slice::from_raw_parts_mut( + memory_buffer.as_ptr().add(positions_offset as usize) as *mut f32, + count * 3 + )}; + let scales_out = unsafe { std::slice::from_raw_parts_mut( + memory_buffer.as_ptr().add(scales_offset as usize) as *mut f32, + count * 3 + )}; + let rotations_out = unsafe { std::slice::from_raw_parts_mut( + memory_buffer.as_ptr().add(rotations_offset as usize) as *mut f32, + count * 4 + )}; + let colors_out = unsafe { std::slice::from_raw_parts_mut( + memory_buffer.as_ptr().add(colors_offset as usize) as *mut u8, + count * 4 + )}; + + positions_out.copy_from_slice(&self.temp_positions[..count * 3]); + scales_out.copy_from_slice(&self.temp_scales[..count * 3]); + rotations_out.copy_from_slice(&self.temp_rotations[..count * 4]); + colors_out.copy_from_slice(&self.temp_colors[..count * 4]); + + Ok(()) + } +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/textureGen.rs b/temp_wasm/cesiumjs-gsplat-utils/src/textureGen.rs new file mode 100644 index 000000000000..e1ab9920f2bc --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/textureGen.rs @@ -0,0 +1,172 @@ +use wasm_bindgen::prelude::*; +use std::mem; +use js_sys::{Float32Array, Uint8Array, Uint32Array, Array}; +use web_sys::console::*; + +#[wasm_bindgen] +pub struct TextureData { + + data: Vec<u32>, + width: u32, + height: u32, +} + +#[wasm_bindgen] +impl TextureData { + #[wasm_bindgen(getter)] + pub fn data(&self) -> Vec<u32> { + self.data.clone() + } + + #[wasm_bindgen(getter)] + pub fn width(&self) -> u32 { + self.width + } + + #[wasm_bindgen(getter)] + pub fn height(&self) -> u32 { + self.height + } + + pub fn new(data: Vec<u32>, width: u32, height: u32) -> Self { + TextureData { + data, + width, + height + } + } +} + +//Algorithm from ILM +//https://github.com/mitsuba-renderer/openexr/blob/master/IlmBase/Half/half.cpp +fn float_to_half(f: f32) -> i16 { + let f_int = f.to_bits() as i32; + let sign = (f_int >> 16) & 0x00008000; + let mut exp = ((f_int >> 23) & 0x000000ff) - (127 - 15); + let mut frac = f_int & 0x007fffff; + + if exp <= 0 { + if exp < -10 { + return sign as i16; + } + + frac = frac | 0x00800000; + + let t = 14 - exp; + let a = (1 << (t - 1)) - 1; + let b = (frac >> t) & 1; + + frac = (frac + a + b) >> t; + return (sign | frac) as i16; + } else if exp == 0xff - (127 - 15) { + if frac == 0 { + return (sign | 0x7c00) as i16; + } else { + frac >>= 13; + return (sign | 0x7c00 | frac | ((frac == 0) as i32)) as i16; + } + } + + frac = frac + 0x00000fff + ((frac >> 13) & 1); + + if frac & 0x00800000 != 0 { + frac = 0; + exp += 1; + } + + if exp > 30 { + //the original algo sets cpu overflow here + return (sign | 0x7c00) as i16; + } + (sign | (exp << 10) | (frac >> 13)) as i16 +} + +#[wasm_bindgen] +pub fn generate_texture_from_attrs( + positions: &Float32Array, + scales: &Float32Array, + rots: &Float32Array, + colors: &Uint8Array, + count: usize +) -> Result<TextureData, JsValue> { + let tex_width = 2048; + let tex_height = ((2 * count) as f32 / tex_width as f32).ceil() as u32; + let mut tex_data = vec![0u32; (tex_width * tex_height * 4) as usize]; + + let tex_data_c = unsafe { + std::slice::from_raw_parts_mut( + tex_data.as_mut_ptr() as *mut u8, + tex_data.len() * 4, + ) + }; + + let tex_data_f = unsafe { + std::slice::from_raw_parts_mut( + tex_data.as_mut_ptr() as *mut f32, + tex_data.len(), + ) + }; + + let rotv: Vec<f32> = rots.to_vec(); + let posv: Vec<f32> = positions.to_vec(); + let clrv: Vec<u8> = colors.to_vec(); + let sclv: Vec<f32> = scales.to_vec(); + + for i in 0..count { + tex_data_f[8 * i + 0] = posv[3 * i + 0]; + tex_data_f[8 * i + 1] = posv[3 * i + 1]; + tex_data_f[8 * i + 2] = posv[3 * i + 2]; + + //u8 offsets + tex_data_c[4 * (8 * i + 7) + 0] = clrv[4 * i + 0]; + tex_data_c[4 * (8 * i + 7) + 1] = clrv[4 * i + 1]; + tex_data_c[4 * (8 * i + 7) + 2] = clrv[4 * i + 2]; + tex_data_c[4 * (8 * i + 7) + 3] = clrv[4 * i + 3]; + + let r = rotv[4*i+3]; + let x = rotv[4*i+0]; + let y = rotv[4*i+1]; + let z = rotv[4*i+2]; + let r_matrix = [ + 1.0 - 2.0 * (y * y + z * z), + 2.0 * (x * y + r * z), + 2.0 * (x * z - r * y), + + 2.0 * (x * y - r * z), + 1.0 - 2.0 * (x * x + z * z), + 2.0 * (y * z + r * x), + + 2.0 * (x * z + r * y), + 2.0 * (y * z - r * x), + 1.0 - 2.0 * (x * x + y * y), + ]; + + // S * R multiplication + let s0 = 3 * i + 0; + let s1 = 3 * i + 1; + let s2 = 3 * i + 2; + + let m = [ + r_matrix[0] * sclv[s0], r_matrix[1] * sclv[s0], r_matrix[2] * sclv[s0], + r_matrix[3] * sclv[s1], r_matrix[4] * sclv[s1], r_matrix[5] * sclv[s1], + r_matrix[6] * sclv[s2], r_matrix[7] * sclv[s2], r_matrix[8] * sclv[s2], + ]; + let sigma = [ + m[0] * m[0] + m[3] * m[3] + m[6] * m[6], + m[0] * m[1] + m[3] * m[4] + m[6] * m[7], + m[0] * m[2] + m[3] * m[5] + m[6] * m[8], + m[1] * m[1] + m[4] * m[4] + m[7] * m[7], + m[1] * m[2] + m[4] * m[5] + m[7] * m[8], + m[2] * m[2] + m[5] * m[5] + m[8] * m[8], + ]; + tex_data[8 * i + 4] = ( float_to_half(4.0 * sigma[0]) as u32 & 0xFFFF) | ((float_to_half(4.0 * sigma[1]) as u32 & 0xFFFF) << 16); + tex_data[8 * i + 5] = (float_to_half(4.0 * sigma[2]) as u32 & 0xFFFF) | ((float_to_half(4.0 * sigma[3]) as u32 & 0xFFFF) << 16); + tex_data[8 * i + 6] = (float_to_half(4.0 * sigma[4]) as u32 & 0xFFFF) | ((float_to_half(4.0 * sigma[5]) as u32 & 0xFFFF) << 16); + } + + Ok(TextureData { + data: tex_data, + width: tex_width, + height: tex_height, + }) +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/textureGen_simd.rs b/temp_wasm/cesiumjs-gsplat-utils/src/textureGen_simd.rs new file mode 100644 index 000000000000..845430f2652b --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/textureGen_simd.rs @@ -0,0 +1,202 @@ +#![feature(stdsimd)] + +use wasm_bindgen::prelude::*; +use core::arch::wasm32::*; +use std::mem; + +use crate::textureGen::TextureData; + +// Enable SIMD at the crate level +#[cfg(target_arch = "wasm32")] +#[cfg(target_feature = "simd128")] + +// #[wasm_bindgen] +// pub struct TextureData { +// data: Vec<u32>, +// width: u32, +// height: u32, +// } + +#[wasm_bindgen] +impl TextureData { + #[wasm_bindgen(getter)] + pub fn data(&self) -> Vec<u32> { + self.data.clone() + } + + #[wasm_bindgen(getter)] + pub fn width(&self) -> u32 { + self.width + } + + #[wasm_bindgen(getter)] + pub fn height(&self) -> u32 { + self.height + } +} + +// SIMD optimized version of pack_half_2x16 +#[inline] +unsafe fn pack_half_2x16_simd(a: v128, b: v128) -> v128 { + // Convert f32x4 to i32x4 with rounding + let a_int = i32x4_trunc_sat_f32x4(a); + let b_int = i32x4_trunc_sat_f32x4(b); + + // Shift and pack + let packed = v128_and( + v128_or( + i32x4_shl(a_int, 16), + v128_and(b_int as v128, u32x4_splat(0xFFFF)) + ), + u32x4_splat(0xFFFFFFFF) + ); + + packed +} + + +#[inline] +unsafe fn matrix_multiply_simd(rot: &[f32; 4], scale: &[f32; 3]) -> [v128; 3] { + let quat = v128_load(rot.as_ptr() as *const v128); + let scale_vec = v128_load(scale.as_ptr() as *const v128); + + let q_squared = f32x4_mul(quat, quat); + let two = f32x4_splat(2.0); + let one = f32x4_splat(1.0); + + // First row of rotation matrix + let sum_yz0 = f32x4_add( + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<1>(q_squared)), // y² + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<2>(q_squared)) // z² + ); + let row0 = f32x4_sub(one, f32x4_mul(two, sum_yz0)); + + // Second row - 2(xy + wz) + let xy = f32x4_mul( + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<0>(quat)), // x + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<1>(quat)) // y + ); + let wz = f32x4_mul( + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<3>(quat)), // w + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<2>(quat)) // z + ); + let row1 = f32x4_mul( + two, + f32x4_add(xy, wz) + ); + + // Third row - 2(xz - wy) + let xz = f32x4_mul( + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<0>(quat)), // x + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<2>(quat)) // z + ); + let wy = f32x4_mul( + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<3>(quat)), // w + f32x4_replace_lane::<0>(f32x4_splat(0.0), f32x4_extract_lane::<1>(quat)) // y + ); + let row2 = f32x4_mul( + two, + f32x4_sub(xz, wy) + ); + + // Scale the row + let scaled_row0 = f32x4_mul(row0, f32x4_splat(f32x4_extract_lane::<0>(scale_vec))); + let scaled_row1 = f32x4_mul(row1, f32x4_splat(f32x4_extract_lane::<1>(scale_vec))); + let scaled_row2 = f32x4_mul(row2, f32x4_splat(f32x4_extract_lane::<2>(scale_vec))); + [scaled_row0, scaled_row1, scaled_row2] +} + +#[wasm_bindgen] +#[target_feature(enable = "simd128")] +pub unsafe fn generate_texture_simd( + buffer: &[u8], + vertex_count: usize, +) -> Result<TextureData, JsValue> { + let f_buffer = std::slice::from_raw_parts( + buffer.as_ptr() as *const f32, + buffer.len() / 4, + ); + + let tex_width = 1024 * 2; + let tex_height = ((2 * vertex_count) as f32 / tex_width as f32).ceil() as u32; + let mut tex_data = vec![0u32; (tex_width * tex_height * 4) as usize]; + + let tex_data_c = std::slice::from_raw_parts_mut( + tex_data.as_mut_ptr() as *mut u8, + tex_data.len() * 4, + ); + + let tex_data_f = std::slice::from_raw_parts_mut( + tex_data.as_mut_ptr() as *mut f32, + tex_data.len(), + ); + + // Process vertices in SIMD-friendly chunks where possible + for i in 0..vertex_count { + let pos = v128_load(&f_buffer[8 * i] as *const f32 as *const v128); + v128_store( + &mut tex_data_f[8 * i] as *mut f32 as *mut v128, + pos + ); + + let color_offset = 32 * i + 24; + let color = v128_load32_zero(buffer[color_offset..].as_ptr() as *const u32); + v128_store( + tex_data_c[4 * (8 * i + 7)..].as_ptr() as *mut v128, + color + ); + + let scale = [ + f_buffer[8 * i + 3], + f_buffer[8 * i + 4], + f_buffer[8 * i + 5], + ]; + + let rot = [ + (buffer[32 * i + 28] as f32 - 128.0) / 128.0, + (buffer[32 * i + 29] as f32 - 128.0) / 128.0, + (buffer[32 * i + 30] as f32 - 128.0) / 128.0, + (buffer[32 * i + 31] as f32 - 128.0) / 128.0, + ]; + + let m_rows = matrix_multiply_simd(&rot, &scale); + let sigma0 = f32x4_add( + f32x4_add( + f32x4_mul(m_rows[0], m_rows[0]), + f32x4_mul(m_rows[1], m_rows[1]) + ), + f32x4_mul(m_rows[2], m_rows[2]) + ); + + let sigma1 = f32x4_add( + f32x4_add( + f32x4_mul(m_rows[0], i8x16_shuffle::<4,8,12,0,4,8,12,0,4,8,12,0,4,8,12,0>( + m_rows[0], m_rows[0] + )), + f32x4_mul(m_rows[1], i8x16_shuffle::<4,8,12,0,4,8,12,0,4,8,12,0,4,8,12,0>( + m_rows[1], m_rows[1] + )) + ), + f32x4_mul(m_rows[2], i8x16_shuffle::<4,8,12,0,4,8,12,0,4,8,12,0,4,8,12,0>( + m_rows[2], m_rows[2] + )) + ); + + // Pack results + let four = f32x4_splat(4.0); + let sigma0_scaled = f32x4_mul(sigma0, four); + let sigma1_scaled = f32x4_mul(sigma1, four); + + let packed = pack_half_2x16_simd(sigma0_scaled, sigma1_scaled); + v128_store( + &mut tex_data[8 * i + 4] as *mut u32 as *mut v128, + packed + ); + } + + Ok(TextureData::new( + tex_data, + tex_width, + tex_height, + )) +} \ No newline at end of file diff --git a/temp_wasm/cesiumjs-gsplat-utils/src/utils.rs b/temp_wasm/cesiumjs-gsplat-utils/src/utils.rs new file mode 100644 index 000000000000..b1d7929dc9c4 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/src/utils.rs @@ -0,0 +1,10 @@ +pub fn set_panic_hook() { + // When the `console_error_panic_hook` feature is enabled, we can call the + // `set_panic_hook` function at least once during initialization, and then + // we will get better error messages if our code ever panics. + // + // For more details see + // https://github.com/rustwasm/console_error_panic_hook#readme + #[cfg(feature = "console_error_panic_hook")] + console_error_panic_hook::set_once(); +} diff --git a/temp_wasm/cesiumjs-gsplat-utils/tests/web.rs b/temp_wasm/cesiumjs-gsplat-utils/tests/web.rs new file mode 100644 index 000000000000..578bbb7ce5e4 --- /dev/null +++ b/temp_wasm/cesiumjs-gsplat-utils/tests/web.rs @@ -0,0 +1,21 @@ +//! Test suite for the Web and headless browsers. + +#![cfg(target_arch = "wasm32")] + +extern crate wasm_bindgen_test; +use wasm_bindgen_test::*; + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1 + 1, 2); +} + +#[wasm_bindgen_test] +fn testTexture() { + let buffer: u8[]; + generate_splat_texture( + + ) +} \ No newline at end of file