Skip to content

Commit

Permalink
Fix terrain tile picking in Cesium Inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jan 24, 2020
1 parent bfd66c4 commit 32794ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Change Log
* Fixed a bug where a point in a `PointPrimitiveCollection` is rendered in the middle of the screen instead of being clipped. [#8542](https://github.com/AnalyticalGraphicsInc/cesium/pull/8542)
* Fixed a crash when deleting and re-creating polylines from CZML. `ReferenceProperty` now returns undefined when the target entity or property does not exist, instead of throwing. [#8544](https://github.com/AnalyticalGraphicsInc/cesium/pull/8544)
* Fixed a bug where rapidly updating a PolylineCollection could result in an instanceIndex is out of range error [#8546](https://github.com/AnalyticalGraphicsInc/cesium/pull/8546)
* Fixed terrain tile picking in the Cesium Inspector.

### 1.65.0 - 2020-01-06

Expand Down
12 changes: 8 additions & 4 deletions Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Cartesian3 from '../../Core/Cartesian3.js';
import defined from '../../Core/defined.js';
import defineProperties from '../../Core/defineProperties.js';
import destroyObject from '../../Core/destroyObject.js';
import DeveloperError from '../../Core/DeveloperError.js';
import Ray from '../../Core/Ray.js';
import Rectangle from '../../Core/Rectangle.js';
import ScreenSpaceEventHandler from '../../Core/ScreenSpaceEventHandler.js';
import ScreenSpaceEventType from '../../Core/ScreenSpaceEventType.js';
Expand Down Expand Up @@ -48,6 +50,9 @@ import createCommand from '../createCommand.js';
return bounded;
}

var scratchPickRay = new Ray();
var scratchPickCartesian = new Cartesian3();

/**
* The view model for {@link CesiumInspector}.
* @alias CesiumInspectorViewModel
Expand Down Expand Up @@ -502,10 +507,9 @@ import createCommand from '../createCommand.js';
function selectTile(e) {
var selectedTile;
var ellipsoid = globe.ellipsoid;
var cartesian = that._scene.camera.pickEllipsoid({
x : e.position.x,
y : e.position.y
}, ellipsoid);

var ray = that._scene.camera.getPickRay(e.position, scratchPickRay);
var cartesian = globe.pick(ray, that._scene, scratchPickCartesian);

if (defined(cartesian)) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
Expand Down

0 comments on commit 32794ec

Please sign in to comment.