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 TileBoundingBox #5150

Merged
merged 8 commits into from
Mar 28, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add comments
  • Loading branch information
duvifn committed Mar 27, 2017
commit 4f60b9c7fbeae257060c64071dbc2f87ed75c2d4
4 changes: 4 additions & 0 deletions Source/Scene/TileBoundingBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ define([
var southSurfaceNormal;

if (south > 0.0){
// Compute a plane that doesn't cut through the tile.
cartographicScratch.longitude = (rectangle.west + rectangle.east) * 0.5;
cartographicScratch.latitude = south;
var southCenterCartesian = ellipsoid.cartographicToCartesian(cartographicScratch, rayScratch.origin);
Cartesian3.clone(eastWestNormal,rayScratch.direction);
var westPlane = Plane.fromPointNormal(tileBB.southwestCornerCartesian, tileBB.westNormal, planeScratch);
// Find a point that is on the west and the south planes
IntersectionTests.rayPlane(rayScratch, westPlane, tileBB.southwestCornerCartesian);
southSurfaceNormal = ellipsoid.geodeticSurfaceNormal(southCenterCartesian, cartesian3Scratch2);

Expand All @@ -165,11 +167,13 @@ define([
var north = rectangle.north;
var northSurfaceNormal;
if (north < 0.0){
// Compute a plane that doesn't cut through the tile.
cartographicScratch.longitude = (rectangle.west + rectangle.east) * 0.5;
cartographicScratch.latitude = north;
var northCenterCartesian = ellipsoid.cartographicToCartesian(cartographicScratch, rayScratch.origin);
Cartesian3.negate(eastWestNormal, rayScratch.direction);
var eastPlane = Plane.fromPointNormal(tileBB.northeastCornerCartesian, tileBB.eastNormal, planeScratch);
// Find a point that is on the east and the north planes
IntersectionTests.rayPlane(rayScratch, eastPlane, tileBB.northeastCornerCartesian);
northSurfaceNormal = ellipsoid.geodeticSurfaceNormal(northCenterCartesian, cartesian3Scratch2);

Expand Down