diff --git a/CHANGES.md b/CHANGES.md index c83cacff0d0b..118523c9da86 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js index 12350813f405..53222377acac 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js +++ b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js @@ -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'; @@ -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 @@ -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);