Skip to content

Commit

Permalink
improve description using chris' words
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Jan 8, 2019
1 parent 5831aec commit 92d59b7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/geo/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,17 +606,19 @@ class Transform {
*/
getCameraPoint() {
const pitch = this._pitch;
const latOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);
return this.centerPoint.add(new Point(0, latOffset));
const yOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);
return this.centerPoint.add(new Point(0, yOffset));
}

/*
* When the map is pitched, some of the 3D features that intersect a query will not intersect
* the query at the surface of the earth. Instead the feature may be closer and only intersect
* the query because it extrudes into the air.
*
* `cameraQueryGeometry` is a geometry that includes all the possible 3D features that may intersect
* with the query when the map is pitched.
* This returns a geometry that includes all of the original query as well as all possible ares of the
* screen where the *base* of a visible extrusion could be.
* - For point queries, the line from the query point to the "camera point"
* - For other geometries, the envelope of the query geometry and the "camera point"
*/
getCameraQueryGeometry(queryGeometry: Array<Point>): Array<Point> {
const c = this.getCameraPoint();
Expand Down

0 comments on commit 92d59b7

Please sign in to comment.