Skip to content

Commit

Permalink
Merge pull request #1069 from hpinkos/correctWrapIDL
Browse files Browse the repository at this point in the history
Correct winding order at wrapLongitude
  • Loading branch information
mramato committed Aug 23, 2013
2 parents 160ff84 + d29951d commit 121ec0f
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var geometry = BoxGeometry.createGeometry(box);
* Optimized polyline bounding spheres.
* `Viewer` now automatically sets its clock to that of the first added `DataSource`, regardless of how it was added to the `DataSourceCollection`. Previously, this was only done for dropped files by `viewerDragDropMixin`.
* Upgraded Knockout from version 2.2.1 to 2.3.0.
* Fixed triangulation for polygons that cross the international date line.

### b19 - 2013-08-01

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/GeometryPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,8 @@ define([
indices[4] = 2;
indices[6] = 1;
} else if (p1Behind) {
getXZIntersectionOffsetPoints(p1, p0, u1, q1);
getXZIntersectionOffsetPoints(p1, p2, u2, q2);
getXZIntersectionOffsetPoints(p1, p2, u1, q1);
getXZIntersectionOffsetPoints(p1, p0, u2, q2);

indices[0] = 1;
indices[3] = 2;
Expand Down
67 changes: 58 additions & 9 deletions Specs/Core/GeometryPipelineSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,15 @@ defineSuite([
expect(geometry.indices).toEqual([0, 3, 4, 1, 2, 6, 1, 6, 5]);

var positions = geometry.attributes.position.values;
expect(positions.subarray(0, 3 * 3)).toEqual([-1.0, -1.0, 0.0, -1.0, 1.0, 2.0, -1.0, 2.0, 2.0]);
var expectedPositions = [];
expectedPositions.push(-1.0, -1.0, 0.0, -1.0, 1.0, 2.0, -1.0, 2.0, 2.0);
var midpoint2 = new Cartesian3(-1, -CesiumMath.EPSILON11, 2/3);
var midpoint1 = new Cartesian3(-1, -CesiumMath.EPSILON11, 1);
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
midpoint1.y = -midpoint1.y;
midpoint2.y = -midpoint2.y;
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
expect(positions).toEqual(expectedPositions);
expect(positions.length).toEqual(7 * 3);
});

Expand All @@ -1788,7 +1796,15 @@ defineSuite([
expect(geometry.indices).toEqual([1, 3, 4, 2, 0, 6, 2, 6, 5]);

var positions = geometry.attributes.position.values;
expect(positions.subarray(0, 3 * 3)).toEqual([-1.0, 1.0, 2.0, -1.0, -1.0, 0.0, -1.0, 2.0, 2.0]);
var expectedPositions = [];
expectedPositions.push(-1.0, 1.0, 2.0, -1.0, -1.0, 0.0, -1.0, 2.0, 2.0);
var midpoint1 = new Cartesian3(-1, -CesiumMath.EPSILON11, 2/3);
var midpoint2 = new Cartesian3(-1, -CesiumMath.EPSILON11, 1);
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
midpoint1.y = -midpoint1.y;
midpoint2.y = -midpoint2.y;
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
expect(positions).toEqual(expectedPositions);
expect(positions.length).toEqual(7 * 3);
});

Expand All @@ -1808,7 +1824,16 @@ defineSuite([
expect(geometry.indices).toEqual([2, 3, 4, 0, 1, 6, 0, 6, 5]);

var positions = geometry.attributes.position.values;
expect(positions.subarray(0, 3 * 3)).toEqual([-1.0, 1.0, 2.0, -1.0, 2.0, 2.0, -1.0, -1.0, 0.0]);
var expectedPositions = [];
expectedPositions.push(-1.0, 1.0, 2.0, -1.0, 2.0, 2.0, -1.0, -1.0, 0.0);
var midpoint2 = new Cartesian3(-1, -CesiumMath.EPSILON11, 2/3);
var midpoint1 = new Cartesian3(-1, -CesiumMath.EPSILON11, 1);
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
midpoint1.y = -midpoint1.y;
midpoint2.y = -midpoint2.y;
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
expect(positions).toEqual(expectedPositions);

expect(positions.length).toEqual(7 * 3);
});

Expand All @@ -1818,7 +1843,7 @@ defineSuite([
position : new GeometryAttribute({
componentDatatype : ComponentDatatype.DOUBLE,
componentsPerAttribute : 3,
values : new Float64Array([-1.0, 2.0, 0.0, -1.0, -1.0, 0.0, -1.0, -1.0, 0.0])
values : new Float64Array([-1.0, 1.0, 0.0, -1.0, -1.0, 0.0, -2.0, -1.0, 0.0])
})
},
indices : new Uint16Array([0, 1, 2]),
Expand All @@ -1828,7 +1853,15 @@ defineSuite([
expect(geometry.indices).toEqual([1, 2, 4, 1, 4, 3, 0, 5, 6]);

var positions = geometry.attributes.position.values;
expect(positions.subarray(0, 3 * 3)).toEqual([-1.0, 2.0, 0.0, -1.0, -1.0, 0.0, -1.0, -1.0, 0.0]);
var expectedPositions = [];
expectedPositions.push(-1.0, 1.0, 0.0, -1.0, -1.0, 0.0, -2.0, -1.0, 0.0);
var midpoint1 = new Cartesian3(-1, -CesiumMath.EPSILON11, 0);
var midpoint2 = new Cartesian3(-1.5, -CesiumMath.EPSILON11, 0);
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
midpoint1.y = -midpoint1.y;
midpoint2.y = -midpoint2.y;
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
expect(positions).toEqual(expectedPositions);
expect(positions.length).toEqual(7 * 3);
});

Expand All @@ -1838,7 +1871,7 @@ defineSuite([
position : new GeometryAttribute({
componentDatatype : ComponentDatatype.DOUBLE,
componentsPerAttribute : 3,
values : new Float64Array([-1.0, -1.0, 0.0, -1.0, 2.0, 0.0, -1.0, -1.0, 0.0])
values : new Float64Array([-2.0, -1.0, 0.0, -1.0, 1.0, 0.0, -1.0, -1.0, 0.0])
})
},
indices : new Uint16Array([0, 1, 2]),
Expand All @@ -1848,7 +1881,15 @@ defineSuite([
expect(geometry.indices).toEqual([2, 0, 4, 2, 4, 3, 1, 5, 6]);

var positions = geometry.attributes.position.values;
expect(positions.subarray(0, 3 * 3)).toEqual([-1.0, -1.0, 0.0, -1.0, 2.0, 0.0, -1.0, -1.0, 0.0]);
var expectedPositions = [];
expectedPositions.push(-2.0, -1.0, 0.0, -1.0, 1.0, 0.0, -1.0, -1.0, 0.0);
var midpoint1 = new Cartesian3(-1, -CesiumMath.EPSILON11, 0);
var midpoint2 = new Cartesian3(-1.5, -CesiumMath.EPSILON11, 0);
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
midpoint1.y = -midpoint1.y;
midpoint2.y = -midpoint2.y;
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
expect(positions).toEqual(expectedPositions);
expect(positions.length).toEqual(7 * 3);
});

Expand All @@ -1858,7 +1899,7 @@ defineSuite([
position : new GeometryAttribute({
componentDatatype : ComponentDatatype.DOUBLE,
componentsPerAttribute : 3,
values : new Float64Array([-1.0, -1.0, 0.0, -1.0, -1.0, 0.0, -1.0, 2.0, 0.0])
values : new Float64Array([-1.0, -1.0, 0.0, -2.0, -1.0, 0.0, -1.0, 1.0, 0.0])
})
},
indices : new Uint16Array([0, 1, 2]),
Expand All @@ -1868,7 +1909,15 @@ defineSuite([
expect(geometry.indices).toEqual([0, 1, 4, 0, 4, 3, 2, 5, 6]);

var positions = geometry.attributes.position.values;
expect(positions.subarray(0, 3 * 3)).toEqual([-1.0, -1.0, 0.0, -1.0, -1.0, 0.0, -1.0, 2.0, 0.0]);
var expectedPositions = [];
expectedPositions.push(-1.0, -1.0, 0.0, -2.0, -1.0, 0.0, -1.0, 1.0, 0.0);
var midpoint1 = new Cartesian3(-1, -CesiumMath.EPSILON11, 0);
var midpoint2 = new Cartesian3(-1.5, -CesiumMath.EPSILON11, 0);
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
midpoint1.y = -midpoint1.y;
midpoint2.y = -midpoint2.y;
expectedPositions.push(midpoint1.x, midpoint1.y, midpoint1.z, midpoint2.x, midpoint2.y, midpoint2.z);
expect(positions).toEqual(expectedPositions);
expect(positions.length).toEqual(7 * 3);
});

Expand Down

0 comments on commit 121ec0f

Please sign in to comment.