fixed some eslint complaints

This commit is contained in:
Daniel Leone 2022-04-30 10:34:31 +08:00
parent 26fe02dd88
commit 358a793793
2 changed files with 12 additions and 8 deletions

View File

@ -293,7 +293,8 @@
const trianglePolygons = [];
const trianglePolygonOutlines = [];
triangles = triangles || [];
for (const triangleIdx of triangles) {
for (let i = 0; i < triangles.length; i++) {
const triangleIdx = triangles[i];
const v0 = new Cesium.Cartesian3();
const v1 = new Cesium.Cartesian3();
const v2 = new Cesium.Cartesian3();
@ -351,7 +352,7 @@
function drawOctreeLayer(prims, level) {
prims.removeAll();
if (level == null) {
if (level === null || level === undefined) {
return;
}
const root =
@ -374,9 +375,12 @@
return n.level === level;
});
let i = 0;
for (const n of nodesToDraw) {
const color = Cesium.Color.fromCssColorString(colors[i % 8]);
let colorCycleIndex = 0;
for (let j = 0; j < nodesToDraw.length; j++) {
const n = nodesToDraw[j];
const color = Cesium.Color.fromCssColorString(
colors[colorCycleIndex % 8]
);
const isSpecial = nodeHits.some(function (h) {
return (
@ -396,7 +400,7 @@
root._triangleVerticesCallback,
isSpecial
);
i++;
colorCycleIndex++;
}
}

View File

@ -142,7 +142,7 @@ function rayIntersectOctree(
// find all the nodes which intersect the ray
const hits = [];
const queue = [node];
let queue = [node];
const intersections = [];
while (queue.length) {
const n = queue.pop();
@ -169,7 +169,7 @@ function rayIntersectOctree(
tMax: intersection.tMax,
});
} else {
queue.push(...n.children);
queue = queue.concat(n.children);
}
}
}