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

Fix #2823: Allow small extruded rectangles #2905

Merged
merged 4 commits into from
Jul 28, 2015
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Change Log
* Fixed `PolygonGeometry` clockwise winding order bug.
* Fixed `BillboardCollection` bounding sphere for billboards with a non-center vertical origin. [#2894](https://github.com/AnalyticalGraphicsInc/cesium/issues/2894)
* The globe depth is now rendered during picking when `Scene.depthTestAgainstTerrain` is `true`.
* Fixed extruded `RectangleGeometry` bug for small heights. [#2823](https://github.com/AnalyticalGraphicsInc/cesium/issues/2823)

### 1.11 - 2015-07-01

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/RectangleGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ define([
var i;

var topBottomGeo = constructRectangle(options);
if (CesiumMath.equalsEpsilon(minHeight, maxHeight, 0.1)) {
if (CesiumMath.equalsEpsilon(minHeight, maxHeight, CesiumMath.EPSILON10)) {
return topBottomGeo;
}
topBottomGeo = PolygonPipeline.scaleToGeodeticHeight(topBottomGeo, maxHeight, ellipsoid, false);
Expand Down Expand Up @@ -554,7 +554,7 @@ define([
var stRotation = defaultValue(options.stRotation, 0.0);
var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);
var extrudedHeight = options.extrudedHeight;
var extrude = (defined(extrudedHeight) && Math.abs(surfaceHeight - extrudedHeight) > 1.0);
var extrude = defined(extrudedHeight);
var closeTop = defaultValue(options.closeTop, true);
var closeBottom = defaultValue(options.closeBottom, true);

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/RectangleOutlineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ define([
var minHeight = Math.min(extrudedHeight, surfaceHeight);
var maxHeight = Math.max(extrudedHeight, surfaceHeight);
var geo = constructRectangle(options);
if (CesiumMath.equalsEpsilon(minHeight, maxHeight, 0.1)) {
if (CesiumMath.equalsEpsilon(minHeight, maxHeight, CesiumMath.EPSILON10)) {
return geo;
}
var height = options.height;
Expand Down
2 changes: 1 addition & 1 deletion Specs/Core/RectangleGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ defineSuite([
vertexFormat : VertexFormat.POSITION_ONLY,
rectangle : rectangle,
granularity : 1.0,
extrudedHeight : 0.1
extrudedHeight : CesiumMath.EPSILON14
}));
var positions = m.attributes.position.values;

Expand Down
2 changes: 1 addition & 1 deletion Specs/Core/RectangleOutlineGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ defineSuite([
var m = RectangleOutlineGeometry.createGeometry(new RectangleOutlineGeometry({
rectangle : rectangle,
granularity : 1.0,
extrudedHeight : 0.1
extrudedHeight : CesiumMath.EPSILON14
}));
var positions = m.attributes.position.values;

Expand Down