Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw walls with positions in order given #8955

Merged
merged 3 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### 1.71 - 2020-07-01

##### Breaking Changes :mega:

- Updated `WallGeometry` to respect the order of positions passed in, instead of making the positions respect a counter clockwise winding order. This will only effect the look of walls with an image material. If this changed the way your wall is drawing, reverse the order of the positions.

##### Fixes :wrench:

- Fixed error with `WallGeoemtry` when there were adjacent positions with very close values [#8952](https://github.com/CesiumGS/cesium/pull/8952)
Expand Down
21 changes: 0 additions & 21 deletions Source/Core/WallGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import arrayRemoveDuplicates from "./arrayRemoveDuplicates.js";
import Cartesian3 from "./Cartesian3.js";
import Cartographic from "./Cartographic.js";
import defined from "./defined.js";
import EllipsoidTangentPlane from "./EllipsoidTangentPlane.js";
import CesiumMath from "./Math.js";
import PolygonPipeline from "./PolygonPipeline.js";
import PolylinePipeline from "./PolylinePipeline.js";
import WindingOrder from "./WindingOrder.js";

/**
* @private
Expand Down Expand Up @@ -132,24 +129,6 @@ WallGeometryLibrary.computePositions = function (
maximumHeights = o.topHeights;
minimumHeights = o.bottomHeights;

if (wallPositions.length >= 3) {
// Order positions counter-clockwise
var tangentPlane = EllipsoidTangentPlane.fromPoints(
wallPositions,
ellipsoid
);
var positions2D = tangentPlane.projectPointsOntoPlane(wallPositions);

if (
PolygonPipeline.computeWindingOrder2D(positions2D) ===
WindingOrder.CLOCKWISE
) {
wallPositions.reverse();
maximumHeights.reverse();
minimumHeights.reverse();
}
}

var length = wallPositions.length;
var numCorners = length - 2;
var topPositions;
Expand Down