Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hpinkos committed Jun 25, 2018
1 parent b292bdf commit 8147666
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Change Log
* Fixed a bug causing crashes with custom vertex attributes on `Geometry` crossing the IDL. Attributes will be barycentrically interpolated. [#6644](https://github.com/AnalyticalGraphicsInc/cesium/pull/6644)
* Fixed a bug causing Point Cloud tiles with unsigned int batch-ids to not load. [#6666](https://github.com/AnalyticalGraphicsInc/cesium/pull/6666)
* Fixed a bug with Draco encoded i3dm tiles, and loading two Draco models with the same url. [#6668](https://github.com/AnalyticalGraphicsInc/cesium/issues/6668)
* Fixed a bug caused by creating a polygon with positions at the same longitude/latitude position but different heights [#6731](https://github.com/AnalyticalGraphicsInc/cesium/pull/6731)
* Fixed terrain clipping when the camera was close to flat terrain and was using logarithmic depth. [#6701](https://github.com/AnalyticalGraphicsInc/cesium/pull/6701)
* Fixed KML bug that constantly requested the same image if it failed to load. [#6710](https://github.com/AnalyticalGraphicsInc/cesium/pull/6710)
* Improved billboard and label rendering so they no longer sink into terrain when clamped to ground. [#6621](https://github.com/AnalyticalGraphicsInc/cesium/pull/6621)
Expand Down
7 changes: 5 additions & 2 deletions Source/Core/PolygonGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ define([
var holes = outerNode.holes;

var i;
var length;
if (!perPositionHeight) {
for (i = 0; i < outerRing.length; i++) {
length = outerRing.length;
for (i = 0; i < length; i++) {
ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
}
}
Expand Down Expand Up @@ -247,7 +249,8 @@ define([
var hole = holes[i];
var holePositions = hole.positions;
if (!perPositionHeight) {
for (j = 0; j < holePositions.length; ++j) {
length = holePositions.length;
for (j = 0; j < length; ++j) {
ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
}
}
Expand Down
9 changes: 6 additions & 3 deletions Source/Core/PolygonOutlineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,13 @@ define([
queue.enqueue(polygonHierarchy);
var i;
var j;
var length;
while (queue.length !== 0) {
var outerNode = queue.dequeue();
var outerRing = outerNode.positions;
if (!perPositionHeight) {
for (i = 0; i < outerRing.length; i++) {
length = outerRing.length;
for (i = 0; i < length; i++) {
ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
}
}
Expand All @@ -503,7 +505,8 @@ define([
var hole = outerNode.holes[i];
var holePositions = hole.positions;
if (!perPositionHeight) {
for (j = 0; j < holePositions.length; ++j) {
length = holePositions.length;
for (j = 0; j < length; ++j) {
ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
}
}
Expand Down Expand Up @@ -566,7 +569,7 @@ define([
geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(geometryInstance.geometry.attributes.position.values, height, ellipsoid, !perPositionHeight);

if (defined(polygonGeometry._offsetAttribute)) {
var length = geometryInstance.geometry.attributes.position.values.length;
length = geometryInstance.geometry.attributes.position.values.length;
var applyOffset = new Uint8Array(length / 3);
offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
arrayFill(applyOffset, offsetValue);
Expand Down
2 changes: 1 addition & 1 deletion Specs/Core/PolygonGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ defineSuite([
};

var geometry = PolygonGeometry.createGeometry(new PolygonGeometry({ polygonHierarchy : hierarchy, perPositionHeight: true }));
expect(geometry).not.toBeUndefined();
expect(geometry).toBeDefined();
});

it('computes positions', function() {
Expand Down
2 changes: 1 addition & 1 deletion Specs/Core/PolygonOutlineGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ defineSuite([
};

var geometry = PolygonOutlineGeometry.createGeometry(new PolygonOutlineGeometry({ polygonHierarchy : hierarchy, perPositionHeight: true }));
expect(geometry).not.toBeUndefined();
expect(geometry).toBeDefined();
});

it('computes positions', function() {
Expand Down

0 comments on commit 8147666

Please sign in to comment.